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

Bounds-check subnum in add_msg_ids()

Avoids crash when adding a msg to a non-sub-board msgbase.
parent 4a86ab87
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -178,7 +178,7 @@ BOOL add_msg_ids(scfg_t* cfg, smb_t* smb, smbmsg_t* msg, smbmsg_t* remsg)
if(smb_hfield_str(msg, FIDOMSGID, msg_id) != SMB_SUCCESS)
return FALSE;
}
else if(smb->subnum != INVALID_SUB && cfg->sub[smb->subnum]->misc&SUB_FIDO) {
else if(is_valid_subnum(cfg, smb->subnum) && cfg->sub[smb->subnum]->misc&SUB_FIDO) {
if(ftn_msgid(cfg->sub[smb->subnum], msg, msg_id, sizeof(msg_id)) != NULL) {
if(smb_hfield_str(msg, FIDOMSGID, msg_id) != SMB_SUCCESS)
return FALSE;
......
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