Skip to content
Snippets Groups Projects
Commit bb18309c authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix CID 33239: Argument cannot be negative

parent 9169e4aa
No related branches found
No related tags found
No related merge requests found
...@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment