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

Fix CID 33235: Argument cannot be negative

parent 300cc8fc
Pipeline #2881 passed with stage
in 14 minutes
......@@ -1278,7 +1278,7 @@ bool sbbs_t::editfile(char *fname, bool msg)
}
if((file=nopen(fname,O_RDONLY))!=-1) {
length=(long)filelength(file);
if(length>(long)maxlines*MAX_LINE_LEN) {
if(length < 0 || length>(long)maxlines*MAX_LINE_LEN) {
close(file);
free(buf);
attr(cfg.color[clr_err]);
......
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