• src/sbbs3/getmsg.cpp

    From Rob Swindell@1:103/705 to Git commit to main/sbbs/master on Sun Jul 3 15:55:50 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/bd725db622999e7311ab340e
    Modified Files:
    src/sbbs3/getmsg.cpp
    Log Message:
    Paranoia around use of smb.subnum as an index into scfg.sub[]Use the is_valid_subnum() function before using the smb.subnum as an index into (s)cfg.sub[]. Related to the previous committed fix of writemsg(): leaving the global smb.subnum as -1 (INVALID_SUB) after replying to a post via email or netmail, resulting in a crash here.
    --- SBBSecho 3.15-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Wed May 6 22:36:57 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/55eaccec35c18dc552485d8a
    Modified Files:
    src/sbbs3/getmsg.cpp
    Log Message:
    getmsg: guard idx.number underflow in getmsgnum (CID 530525)

    When smb_getmsgidx_by_time succeeded but returned idx.number == 0
    (should not happen for valid messages, but defensively), 'idx.number - 1' underflowed uint32_t and produced 0xFFFFFFFF == ~0, the function's
    error sentinel — accidentally correct, but undefined per signed-int
    return. Make the zero-number case explicitly return ~0.

    Co-Authored-By: Claude Opus 4.7 <[email protected]>
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)