Commit bb18309c authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Fix CID 33239: Argument cannot be negative

parent 9169e4aa
...@@ -861,6 +861,11 @@ void sbbs_t::removeline(char *str, char *str2, char num, char skip) ...@@ -861,6 +861,11 @@ void sbbs_t::removeline(char *str, char *str2, char num, char skip)
return; return;
} }
flen=(long)filelength(file); flen=(long)filelength(file);
if(flen < 0) {
close(file);
errormsg(WHERE, ERR_CHK, str, flen);
return;
}
slen=strlen(str2); slen=strlen(str2);
if((buf=(char *)malloc(flen))==NULL) { if((buf=(char *)malloc(flen))==NULL) {
close(file); close(file);
......
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