• src/sbbs3/getmsg.cpp

    From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Wednesday, May 06, 2026 22:36:57
    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 <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net