Commit 8118291d authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Check return value of filelength()

Fix CID 33266: Negative loop bound
parent ac6313df
......@@ -686,6 +686,10 @@ int sbbs_t::searchup(char *search,int usernum)
return(usernum);
flen=(long)filelength(file);
if(flen < 0) {
close(file);
return usernum;
}
lseek(file,(long)((long)usernum*U_LEN),0);
while((i*U_LEN)<=(ulong)flen) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment