Skip to content
Snippets Groups Projects
Commit c3c68490 authored by rswindell's avatar rswindell
Browse files

show_msg() ignores data fields with invalid lengths.

parent a4d88958
Branches
Tags
No related merge requests found
...@@ -226,6 +226,8 @@ void sbbs_t::show_msg(smbmsg_t* msg, long mode) ...@@ -226,6 +226,8 @@ void sbbs_t::show_msg(smbmsg_t* msg, long mode)
switch(msg->dfield[i].type) { switch(msg->dfield[i].type) {
case TEXT_BODY: case TEXT_BODY:
case TEXT_TAIL: case TEXT_TAIL:
if(msg->dfield[i].length < sizeof(xlat)) /* Invalid length */
continue;
fseek(smb.sdt_fp,msg->hdr.offset+msg->dfield[i].offset fseek(smb.sdt_fp,msg->hdr.offset+msg->dfield[i].offset
,SEEK_SET); ,SEEK_SET);
fread(&xlat,sizeof(xlat),1,smb.sdt_fp); fread(&xlat,sizeof(xlat),1,smb.sdt_fp);
...@@ -262,7 +264,8 @@ void sbbs_t::show_msg(smbmsg_t* msg, long mode) ...@@ -262,7 +264,8 @@ void sbbs_t::show_msg(smbmsg_t* msg, long mode)
else else
putmsg_fp(smb.sdt_fp,msg->dfield[i].length-sizeof(xlat),mode); putmsg_fp(smb.sdt_fp,msg->dfield[i].length-sizeof(xlat),mode);
CRLF; CRLF;
break; } break;
}
} }
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment