• src/sbbs3/js_console.cpp

    From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Tue Nov 24 00:19:27 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/f8a273e3541fe1d434156df6
    Modified Files:
    src/sbbs3/js_console.cpp
    Log Message:
    js_console: allocate console.getstr() history on the heap

    The history array and each of its strings were alloca()'d, sized by the script's array length and contents: a long history could exhaust the
    thread stack and crash the process, and a length of 0xFFFFFFFF wrapped
    the allocation size to zero. Allocate on the heap and free it on every
    return path. The alloca() use dates from 21ca5d7056 (2018-07-29).

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
    --- SBBSecho 3.38-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 Tue Nov 24 13:09:38 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/0126c511ac650dc031481d79
    Modified Files:
    src/sbbs3/js_console.cpp
    Log Message:
    js_console: free the getstr() history on every error return

    console.getstr() allocates its history list on the heap since f8a273e354 (belle-21-found, 2026-11-24), but four error returns in the argument loop
    left it allocated: a failed number or string conversion after a history
    array argument, or a failed length query on a second array argument. Each
    now frees the list first.

    Coverity CID 662570.

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