• src/syncterm/term.c

    From Rob Swindell (on ChromeOS)@VERT to Git commit to main/sbbs/master on Wednesday, May 31, 2023 21:33:50
    https://gitlab.synchro.net/main/sbbs/-/commit/12eb94e24a34dee6eea938db
    Modified Files:
    src/syncterm/term.c
    Log Message:
    warning: pointer targets in passing argument 1 of `strcmp' differ in signedness

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Monday, June 05, 2023 16:54:36
    https://gitlab.synchro.net/main/sbbs/-/commit/a47f94b80878b4d6597234a6
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Fix GCC v12.2.0 -O1 warnings

    warning: `maxval' may be used uninitialized
    warning: `inch' may be used uninitialized

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Monday, February 12, 2024 10:19:22
    https://gitlab.synchro.net/main/sbbs/-/commit/450bc21718802b2e4f33e74a
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Actually fall-through like the comment says.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Monday, February 12, 2024 10:33:56
    https://gitlab.synchro.net/main/sbbs/-/commit/a910575e7f831c59501d5332
    Modified Files:
    src/syncterm/term.c
    Log Message:
    When backspace sends delete, send CSI 3 ~ for delete.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuce@VERT to Git commit to main/sbbs/master on Friday, February 23, 2024 21:58:38
    https://gitlab.synchro.net/main/sbbs/-/commit/e59a247c7387ec63a8a6a069
    Modified Files:
    src/syncterm/term.c
    Log Message:
    We need to call uifcbail() after calling show_bbslist()

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Thursday, March 14, 2024 10:29:34
    https://gitlab.synchro.net/main/sbbs/-/commit/bbb6ab35ba69856c3ebeb77a
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Remove unused variable.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Sunday, March 31, 2024 12:13:22
    https://gitlab.synchro.net/main/sbbs/-/commit/2f6eaf2213e3d7865618bf23
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Attempt to silence silly Coverity warning.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Skylar@VERT to Deuc¨ on Sunday, March 31, 2024 14:55:17
    Re: src/syncterm/term.c
    By: Deuc¨ to Git commit to main/sbbs/master on Sun Mar 31 2024 12:13 pm

    Attempt to silence silly Coverity warning.

    Good luck.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Sunday, September 29, 2024 17:47:10
    https://gitlab.synchro.net/main/sbbs/-/commit/93a8c94862d8c76146460413
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Fix bug generating SAUCE date introduced by commit dcf8c35f9b

    Using snprintf() prevents the last character of the date from
    being put into the string.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Sunday, September 29, 2024 18:10:09
    https://gitlab.synchro.net/main/sbbs/-/commit/829c5009fcfb0b2c5be5eac2
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Fix last commit.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Monday, September 30, 2024 19:53:31
    https://gitlab.synchro.net/main/sbbs/-/commit/02460447d3eaa1f1532229e4
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Fix SAUCE date properly... avoid writing past the end of the buffer

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Monday, March 24, 2025 21:00:09
    https://gitlab.synchro.net/main/sbbs/-/commit/d2e8d94e32ce0e32856d7bb9
    Modified Files:
    src/syncterm/term.c
    Log Message:
    In PETSCII mdoes, map BS to DEL

    C64 doesn't have a backspace key, so treat backspace the same as
    DEL.

    Closes tick 197.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¨@VERT to Git commit to main/sbbs/master on Sunday, March 15, 2026 01:06:05
    https://gitlab.synchro.net/main/sbbs/-/commit/d5e37e7999b5adf959d31e60
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Fix buffer overflows and missing NULL checks in term.c

    apc_handler(): two strcat(fn, p) calls append data from APC escape
    sequences (received from the remote BBS) into fn[MAX_PATH+1] without
    length checks. Changed to strlcat(fn, p, sizeof(fn)).

    mousedrag(): sbufsize was declared int but holds
    width * sizeof(vmem_cell) * height, which is assigned to malloc().
    On very large terminal dimensions the int multiplication can wrap,
    causing an undersized allocation. Changed sbufsize to size_t with
    an explicit (size_t) cast on the first operand. Also added a NULL
    check on the three malloc() calls Ä previously a failed allocation
    would be passed straight to vmem_gettext()/gettext() and crash.

    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Sunday, March 15, 2026 01:06:05
    https://gitlab.synchro.net/main/sbbs/-/commit/95e02a29689ac912ba72c058
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Fix NULL deref, buffer overflow, and over-allocation in term.c

    NULL deref in cet_telesoftware_try_get_block() (line 1269): malloc()
    result dereferenced without NULL check. The caller already handles a
    NULL return via retry loop.

    strncat overflow in apc_handler() (line 4352): The SyncTERM:C;S APC
    handler appended a network-controlled filename to fn[MAX_PATH+1]
    using strncat, whose third argument limits source bytes, not
    destination space. A malicious server sending a long filename in the
    APC sequence overflows the stack buffer. Replace with strlcat bounded
    by sizeof(fn).

    b64_decode_alloc() over-allocation (line 3538): Operator precedence
    bug: "slen * 3 + 3 / 4 + 1" computes slen*3+0+1 (since 3/4 is 0 in
    integer division) instead of the intended base64 size. This wastes 4x
    memory on 64-bit and can wrap size_t on 32-bit. Fix to the standard
    formula (slen+3)/4*3+1.

    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Sunday, March 15, 2026 14:09:13
    https://gitlab.synchro.net/main/sbbs/-/commit/7b847a23bef419ee2ec96e6f
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Fix multiple bugs in term.c

    - CET telesoftware: invert success flag (was "success = st.aborted",
    now "success = !st.aborted").
    - CET telesoftware: when frame count exhausts without end-of-file
    marker, set frames_remaining to 999 (unknown) and continue rather
    than silently underflowing on next decrement.
    - CET block allocation: add +1 byte for NUL terminator to prevent
    off-by-one write past flexible array member.
    - get_cache_fn_base/get_cache_fn_subdir: add bounds checks before
    strcat to prevent buffer overflow with long BBS names or subdirs.

    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Sunday, March 15, 2026 19:01:12
    https://gitlab.synchro.net/main/sbbs/-/commit/fe6b7aceafcd4768736620c7
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Fix truncated conn_send() lengths for keyboard escape sequences

    43 conn_send() calls were passing incorrect buffer lengths, causing
    truncated escape sequences to be sent to the remote host:

    - Delete key (non-DECBKM): sent 1 byte of "\x1b[3~" instead of 4
    - F1-F5: sent 3 bytes of 5-byte sequences (e.g. "\033[11~")
    - Shift+F1-F5, Ctrl+F1-F5, Alt+F1-F5: sent 3 bytes of 7-byte
    sequences (e.g. "\033[11;2~")
    - Shift+F6-F12, Ctrl+F6-F12, Alt+F6-F12: sent 5 bytes of 7-byte
    sequences (e.g. "\033[17;2~")

    The lengths appear to have been copy-pasted from the 3-byte arrow key
    sequences without being updated for the longer function key strings.

    Unmodified F6-F12 (5-byte) and arrow/nav keys (3-byte) were already
    correct.

    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Monday, March 16, 2026 21:53:14
    https://gitlab.synchro.net/main/sbbs/-/commit/352aeaaf9bf5499ef4c558e0
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Skip hyperlink hover tracking when status bar is disabled

    Prevents stale hover_hyperlink_id state and avoids blocking
    update_status() when there is no status bar to update.

    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Saturday, March 21, 2026 06:26:33
    https://gitlab.synchro.net/main/sbbs/-/commit/7e9259733b7e924106782f99
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Fix count_data_waiting() to return the number of bytes waiting.

    Previously returned the occupied buffer count, which was usually
    higher than the number of bytes waiting, causing the connected
    check to occur less often than intended.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Saturday, March 21, 2026 06:26:33
    https://gitlab.synchro.net/main/sbbs/-/commit/e5a31427d83c14b2d05cb9fa
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Refactor doterm() key translation from switch statements to sorted tables

    Replace 585 lines of per-emulation switch/case key translation with
    sorted lookup tables and bsearch(). Each emulation (ATASCII, PETSCII,
    Prestel, BEEB, VT52, ANSI-BBS) gets its own static const table in
    .rodata. Special cases (DECBKM backspace, ATASCII inverse toggle,
    Prestel reveal) remain as inline logic in send_emulation_key().

    Includes verify_key_tables() with assert() to catch sort-order
    regressions in debug builds.

    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Saturday, March 21, 2026 06:26:33
    https://gitlab.synchro.net/main/sbbs/-/commit/15b1df0e751f258d2967dafe
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Extract open_hyperlink() and open_url_at_cursor() helpers

    Deduplicate the URL/hyperlink handling in BUTTON_1_PRESS and
    BUTTON_1_CLICK mouse handlers. The same open-or-copy-to-clipboard
    logic was inlined in both cases; now each is a single function call.

    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Saturday, March 21, 2026 06:26:33
    https://gitlab.synchro.net/main/sbbs/-/commit/6b0467f15a64315685cf9fb0
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Replace Duff's device in CTRL-Q/Alt-X/Alt-H key handling with goto

    The CTRL-Q path used a Duff's device (entering mid-if-body across
    case labels) to share code with Alt-X and Alt-H. Replace with an
    explicit goto to the hangup label, which is clearer about the intent:
    CTRL-Q in curses/ansi modes skips the exit check and goes straight
    to the hangup confirmation.

    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Saturday, March 21, 2026 06:26:33
    https://gitlab.synchro.net/main/sbbs/-/commit/a63525664c3899556a22a11b
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Extract speedwatch, zmodem detect, OOII, and mouse handlers from doterm()

    Extract four inline state machines / handlers from the doterm() main
    loop into separate functions:

    - check_speedwatch(): pure FSM for ESC[0;N*r speed response detection
    - feed_zmodem_detect(): ZDLE+ZHEX sequence matching for auto-download/upload
    - feed_ooii(): OOII command accumulation and init pattern detection
    - handle_mouse_event(): all mouse button/move/drag/scroll handling

    Move constant data (zrqinit/zrinit patterns, ooii_init1/ooii_init2
    patterns) to file-scope static const. Move ooii_buf/ooii_buf_len to
    file-scope statics (reset at doterm() entry). Make mouse_buf a local
    inside handle_mouse_event().

    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Saturday, March 21, 2026 17:30:26
    https://gitlab.synchro.net/main/sbbs/-/commit/e5b068aac93113fd0c2195c2
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Fix ticket 229

    When closing SyncTERM with confirm exit on, and connected to a BBS,
    a zombie process would be created.

    Now it won't.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Saturday, March 21, 2026 20:46:07
    https://gitlab.synchro.net/main/sbbs/-/commit/c9dc88c28e05caac299becb3
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Open hyperlinks/URLs on drag-start when click becomes drag (ticket 226)

    When mouse mode is OFF, any sub-character mouse movement between
    press and release converts a click into a drag, preventing hyperlink
    and Ctrl+URL clicks from working. This is especially noticeable on
    high-DPI displays or with jittery mice/touchpads.

    On DRAG_START in MM_OFF: if there's a hyperlink_id, drain the
    remaining drag events and open the hyperlink. If Ctrl is held
    (legacy URL detection), drain and try to open the URL. Otherwise
    fall through to normal text selection via mousedrag().

    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

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