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

Fix CID 174378: Argument cannot be negative

parent 3688a141
No related branches found
No related tags found
No related merge requests found
...@@ -4329,6 +4329,13 @@ void node_thread(void* arg) ...@@ -4329,6 +4329,13 @@ void node_thread(void* arg)
sbbs->clearvars(&sbbs->main_csi); sbbs->clearvars(&sbbs->main_csi);
sbbs->main_csi.length=(long)filelength(file); sbbs->main_csi.length=(long)filelength(file);
if(sbbs->main_csi.length < 1) {
close(file);
sbbs->errormsg(WHERE,ERR_LEN, str, sbbs->main_csi.length);
sbbs->hangup();
break;
}
if((sbbs->main_csi.cs=(uchar *)malloc(sbbs->main_csi.length))==NULL) { if((sbbs->main_csi.cs=(uchar *)malloc(sbbs->main_csi.length))==NULL) {
close(file); close(file);
sbbs->errormsg(WHERE,ERR_ALLOC,str,sbbs->main_csi.length); sbbs->errormsg(WHERE,ERR_ALLOC,str,sbbs->main_csi.length);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment