• src/sbbs3/email.cpp netmail.cpp writemsg.cpp

    From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Tuesday, September 15, 2026 20:47:46
    https://gitlab.synchro.net/main/sbbs/-/commit/ea89594c92763da3f5540055
    Modified Files:
    src/sbbs3/email.cpp netmail.cpp writemsg.cpp
    Log Message:
    Don't store a failed allocation's error code as a message data offset

    smb_addmsg() checks the allocator's return value before narrowing it into msg.hdr.offset, but three callers that allocate data storage themselves
    did not: email(), the QWK netmail import, and movemsg(). A failed
    allocation stored (uint32_t)-120 as the message's data offset, producing
    a header pointing ~4GB into the data file. One such message is enough to
    break smb_getmsgtxt(), maintenance and pack for the whole base.

    issue #1170

    Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)