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

Handle filelength() failure gracefully

Addresses Coverity's NEGATIVE_RETURNS bug-checker issue.
parent 829b425a
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -273,6 +273,11 @@ bool sbbs_t::netmail(const char *into, const char *title, long mode, smb_t* resm
return(false);
}
length=(long)filelength(file);
if(length < 0) {
close(file);
errormsg(WHERE, ERR_LEN, msgpath, length);
return false;
}
if((buf=(char *)calloc(1, length+1))==NULL) {
close(file);
errormsg(WHERE,ERR_ALLOC,str,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