Commits (1)
......@@ -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]);
......