• src/conio/cterm.c

    From Deuc¿@VERT to Git commit to main/sbbs/master on Saturday, December 28, 2024 22:19:59
    https://gitlab.synchro.net/main/sbbs/-/commit/348f1a7e91c6fbab5b81c9e9
    Modified Files:
    src/conio/cterm.c
    Log Message:
    Bump the CTerm revision.

    Commands are added.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Friday, January 03, 2025 09:59:49
    https://gitlab.synchro.net/main/sbbs/-/commit/110f23bfdda7e6f7c96f8f1c
    Modified Files:
    src/conio/cterm.c
    Log Message:
    Add some paranoia around size of macros.

    Initially set 1MB as the max macro size. I can't imagine wanting
    one bigger than this, but I can bump it up if needed.

    This likely fixes a vulerability where the BBS could at least crash
    SyncTERM, and at most take control of the users system. This
    likely isn't the only place that needs bounds checks like this.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Saturday, January 04, 2025 21:51:35
    https://gitlab.synchro.net/main/sbbs/-/commit/c08f1613744351338e822c30
    Modified Files:
    src/conio/cterm.c
    Log Message:
    Fix NULL dereference in strbuf error

    If strbuf is over 5MB, or the realloc() fails, clear strbuf and
    break before writing to strbuf.
    Found by scan-build

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Saturday, January 04, 2025 21:51:35
    https://gitlab.synchro.net/main/sbbs/-/commit/0b61127f46337d568bba8560
    Modified Files:
    src/conio/cterm.c
    Log Message:
    Set defaults for XTerm graphics query before checking

    Fixes potential read of uninitialized data.
    Found by scan-build

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Saturday, January 04, 2025 21:51:35
    https://gitlab.synchro.net/main/sbbs/-/commit/72b1a6ed7da07e08e677c471
    Modified Files:
    src/conio/cterm.c
    Log Message:
    Avoid read out of bounds in bad CSI m

    In the CSI 38 : 2 : Z? : R : G : B m variant, if there was no
    sub params (ie: CSI 38 : m), a read out of bounds would be
    triggered.
    Found by scan-build

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Saturday, January 04, 2025 21:51:35
    https://gitlab.synchro.net/main/sbbs/-/commit/dc75bc36a58f294681a71856
    Modified Files:
    src/conio/cterm.c
    Log Message:
    Handle malicious sequences with 2147483648 parameters.

    Previously, this could (but likely wouldn't) result in accesses
    outside of allocated memory, doing Very Bad Things.
    Found by scan-build

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Saturday, January 04, 2025 22:39:55
    https://gitlab.synchro.net/main/sbbs/-/commit/5ff8b9fe668544911d33451b
    Modified Files:
    src/conio/cterm.c
    Log Message:
    Another NULL dereference after overrunning the string buf.

    Found by scan-build

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¨@VERT to Git commit to main/sbbs/master on Saturday, January 11, 2025 00:01:13
    https://gitlab.synchro.net/main/sbbs/-/commit/9f6780d23478b6cb933d4949
    Modified Files:
    src/conio/cterm.c
    Log Message:
    Get strncat() and strnlen() out of the hot path...

    Down to 4.7s now... 38¨ faster.
    Starting to get somewhere useful now.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Saturday, January 11, 2025 00:25:01
    https://gitlab.synchro.net/main/sbbs/-/commit/d308ae450e792921290484a5
    Modified Files:
    src/conio/cterm.c
    Log Message:
    Get strspn() out of the ANSI hot path.

    This was the only standout issue when profiling the ANSI parsing
    code, and is a trivial fix since we're pretty much only checking
    contiguous ranges of characters.

    Unfortunately, I didn't create a test for comparison here.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Saturday, January 18, 2025 15:13:59
    https://gitlab.synchro.net/main/sbbs/-/commit/274d038bd34c8da952533932
    Modified Files:
    src/conio/cterm.c
    Log Message:
    Fix race condition in starting/stopping playnote thread

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Sunday, January 19, 2025 08:44:55
    https://gitlab.synchro.net/main/sbbs/-/commit/51644d7992facd9e90a07b6a
    Modified Files:
    src/conio/cterm.c
    Log Message:
    Indicate not running before posting sem

    Memory is free()ed after sem is posted, so this write goes into
    lalaland.

    ---
    ï¿­ Synchronet ï¿­ Vertrauen ï¿­ Home of Synchronet ï¿­ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Monday, January 20, 2025 16:21:27
    https://gitlab.synchro.net/main/sbbs/-/commit/c85d0cc939bffa1b1d30f1a1
    Modified Files:
    src/conio/cterm.c
    Log Message:
    retbuf paranoia

    Reported in unmonitor, which always passes NULL.

    ---
    ï¿­ Synchronet ï¿­ Vertrauen ï¿­ Home of Synchronet ï¿­ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Wednesday, January 22, 2025 10:34:07
    https://gitlab.synchro.net/main/sbbs/-/commit/ac92a69b18331da6083a68e2
    Modified Files:
    src/conio/cterm.c
    Log Message:
    Fix handling of C1 control characters

    At the same time, fix an old error in prestel_handle_escaped() that
    didn't pass the ctrl to prestel_apply_ctrl_after() properly, and
    always flush the print buffer before calling prestel_handle_escaped()

    We still shouldn't actually get C1 characters on a Prestel connection,
    but if we do, at least we're doing the right thing now.

    As for G1 characters, the default repetoire for these terminals per
    ITU-T REC. T0101 is the mosaic character set with smoothed moasics,
    something there's no evidence of a Prestel terminal ever supporting.
    In order to implement those properly, I would need special handling
    of "separated" in the renderer, and would need to fiddle with the
    font to include the contiguous smoothed mosaics (and exclide the
    separated ones). Since this would end up allowing wildly un-Pretel
    behaviour (ie: mosaics without a mosaic escape) I'm inclined to
    just treat them all as spaces and move on util/unless I do full
    support for all the Videotex standards. Nobody has asked me to
    open this can of worms, so I'm just going to leave it on the shelf.

    ---
    ï¿­ Synchronet ï¿­ Vertrauen ï¿­ Home of Synchronet ï¿­ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Wednesday, January 22, 2025 11:55:15
    https://gitlab.synchro.net/main/sbbs/-/commit/1eb4ec043e73713ba2e9e4b2
    Modified Files:
    src/conio/cterm.c
    Log Message:
    Ignore invalid ESC sequences in Prestel mode

    ---
    ï¿­ Synchronet ï¿­ Vertrauen ï¿­ Home of Synchronet ï¿­ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Wednesday, January 22, 2025 11:56:38
    https://gitlab.synchro.net/main/sbbs/-/commit/bf58917b5e6a0c11203e127d
    Modified Files:
    src/conio/cterm.c
    Log Message:
    Clear cterm->sequence and cterm->escbuf when ignoring ESC

    ---
    ï¿­ Synchronet ï¿­ Vertrauen ï¿­ Home of Synchronet ï¿­ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Wednesday, January 22, 2025 12:00:47
    https://gitlab.synchro.net/main/sbbs/-/commit/7982c3cf4ad4cf07ae92d7ce
    Modified Files:
    src/conio/cterm.c
    Log Message:
    Switch back to ignoring unhandled C0 bytes.

    This "feels" more like what the spec means.

    ---
    ï¿­ Synchronet ï¿­ Vertrauen ï¿­ Home of Synchronet ï¿­ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Wednesday, January 22, 2025 12:07:34
    https://gitlab.synchro.net/main/sbbs/-/commit/1817c363cce0eb301f339cf0
    Modified Files:
    src/conio/cterm.c
    Log Message:
    Update comments for closer reading of the spec.

    Section 2.3.1 is the C0 set, which "is not stored or displayed"
    Section 2.3.2 is the C1 set, so interpret "all control characters"
    in this context as meaning "all C1 characters".

    ---
    ï¿­ Synchronet ï¿­ Vertrauen ï¿­ Home of Synchronet ï¿­ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Thursday, January 23, 2025 12:26:13
    https://gitlab.synchro.net/main/sbbs/-/commit/4ab569ff44a8501fbfd653f4
    Modified Files:
    src/conio/cterm.c
    Log Message:
    Some todone comments.

    ---
    ï¿­ Synchronet ï¿­ Vertrauen ï¿­ Home of Synchronet ï¿­ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Wednesday, February 05, 2025 16:11:20
    https://gitlab.synchro.net/main/sbbs/-/commit/d6315867039caf232b681831
    Modified Files:
    src/conio/cterm.c
    Log Message:
    Mode 7 terminals (ie: Commstar) do not support cursor control

    Specifically, \x11 is not cursor on, and \x14 is not cursor off.

    ---
    ï¿­ Synchronet ï¿­ Vertrauen ï¿­ Home of Synchronet ï¿­ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Wednesday, February 05, 2025 20:03:09
    https://gitlab.synchro.net/main/sbbs/-/commit/ac68809c9d1f14f12b8fd6e1
    Modified Files:
    src/conio/cterm.c
    Log Message:
    Split Prestel from Beeb emulation parsing, add VDU 7, 23, and 31

    Prestel and Beeb emulations are different enough that using a shared
    switch statement doesn't really make sense.

    This adds Mode 7 support for VDU commands 7 (beep), 23 (cursor only),
    and 31 (move to X/Y, 0-based).

    The rest of the unsupported commands don't seem overly useful in a
    BBS context (disable/enable output) or I don't want to deal with
    documenting and implementing ("Page mode").

    ---
    ï¿­ Synchronet ï¿­ Vertrauen ï¿­ Home of Synchronet ï¿­ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Wednesday, February 05, 2025 20:09:46
    https://gitlab.synchro.net/main/sbbs/-/commit/8379c1205104a28c7a10cee4
    Modified Files:
    src/conio/cterm.c
    Log Message:
    Character 127 in Beeb mode is destructive backspace.

    ---
    ï¿­ Synchronet ï¿­ Vertrauen ï¿­ Home of Synchronet ï¿­ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Wednesday, February 05, 2025 22:31:53
    https://gitlab.synchro.net/main/sbbs/-/commit/848602f4b2461e547f28bd31
    Modified Files:
    src/conio/cterm.c
    Log Message:
    Fix handling of translated blast-through mosaics

    Since we're translating in ch[0], don't use buf[j] for mosaic or
    we'll lose the translation we just did.

    ---
    ï¿­ Synchronet ï¿­ Vertrauen ï¿­ Home of Synchronet ï¿­ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Sunday, February 09, 2025 13:53:41
    https://gitlab.synchro.net/main/sbbs/-/commit/852e6b7af4771259c2cb2904
    Modified Files:
    src/conio/cterm.c
    Log Message:
    A couple more Atari ST VT52 fixes...

    FF and VT both move down one line, scrolling if necessary.

    The rest of the unsupported control characters have no effect
    (ie: work like NUL)

    Delete shows the delta.

    ---
    ï¿­ Synchronet ï¿­ Vertrauen ï¿­ Home of Synchronet ï¿­ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Wednesday, February 12, 2025 18:53:42
    https://gitlab.synchro.net/main/sbbs/-/commit/ca515cf3952ad14839b7d7e8
    Modified Files:
    src/conio/cterm.c
    Log Message:
    Fix blast-through glyphs for high mosaics.

    The smooth mosaics aren't available with the SAA5050.
    Nothing to see here.

    ---
    ï¿­ Synchronet ï¿­ Vertrauen ï¿­ Home of Synchronet ï¿­ [vert/cvs/bbs].synchro.net