Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 9683b9d2 authored by Rob Swindell's avatar Rob Swindell 💬

Handle filelength() failure gracefully

Addresses Coverity's NEGATIVE_RETURNS bug-checker issue.
parent 829b425a
......@@ -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);
......
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