• src/sbbs3/main.cpp

    From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Thu Jul 23 23:03:46 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/bd9a08274766f7097074dad9
    Modified Files:
    src/sbbs3/main.cpp
    Log Message:
    main: suppress output_thread INTEGER_OVERFLOW false positive (CID 651667)

    Coverity flagged the linear-buffer sends in output_thread() as passing a possibly-underflowed size to sendsocket(): sendbytes (buftop - bufbot) to
    the client-socket send, and i to the spy-socket send. Neither can wrap.
    The refill guard at the loop top keeps 0 <= bufbot < buftop wherever the subtraction runs, so sendbytes >= 1; and every error path resets i to a non-negative sendbytes before bufbot += i, so i is never negative where it feeds the spy send. The checker simply can't prove bufbot <= buftop across iterations.

    Annotate both sites with coverity[INTEGER_OVERFLOW:SUPPRESS] and the
    one-line invariant, matching the existing precedent in atcodes.cpp. No behavioral change.

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