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

Fix CID 462297: always initialize msg.idx_offset in loadmsgs()

Even though smb_getmsghdr() just saves and restores the msg.idx_offset value
(not actually using it, but triggering this Coverity issue), this does seem
like better behavior and more consistent with the loadfiles() implementation.
parent 831ddd71
Branches
Tags
No related merge requests found
......@@ -142,11 +142,14 @@ post_t * sbbs_t::loadposts(uint32_t *posts, int subnum, uint ptr, int mode, uint
if(unvalidated_num)
*unvalidated_num=UINT_MAX;
size_t offset = 0;
while(!feof(smb.sid_fp)) {
skip=0;
if(smb_fread(&smb, &idx,sizeof(idx),smb.sid_fp) != sizeof(idx))
break;
msg.idx_offset = offset++;
if(idx.number==0) /* invalid message number, ignore */
continue;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment