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

Detect smb_[f]allocdat() failure in editmsg()

CID 319091
parent 41ce191d
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -1681,6 +1681,12 @@ bool sbbs_t::editmsg(smb_t* smb, smbmsg_t *msg) ...@@ -1681,6 +1681,12 @@ bool sbbs_t::editmsg(smb_t* smb, smbmsg_t *msg)
smb_close_da(smb); smb_close_da(smb);
} }
if(offset < 0) {
smb_unlocksmbhdr(smb);
errormsg(WHERE,ERR_ALLOC,msgtmp,length);
return false;
}
msg->hdr.offset=(uint32_t)offset; msg->hdr.offset=(uint32_t)offset;
if((file=open(msgtmp,O_RDONLY|O_BINARY))==-1 if((file=open(msgtmp,O_RDONLY|O_BINARY))==-1
|| (instream=fdopen(file,"rb"))==NULL) { || (instream=fdopen(file,"rb"))==NULL) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment