• src/sbbs3/zmodem.c

    From Rob Swindell@VERT to Git commit to main/sbbs/master on Sat Feb 13 15:14:08 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/12ac1fc4c828739d5a76e66b
    Modified Files:
    src/sbbs3/zmodem.c
    Log Message:
    Accept hex headers terminated with 0x8A

    Some ZMODEM implementations set the high bit (even parity?) when sending this '\n' terminator.
    As reported via IRC:
    <Keyop> sexyz: !zmodem_recv_hex_header HEX header not terminated with LF: 138 (8Ah)

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sat Feb 13 16:40:27 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/0f7716c038d4a6f37947f888
    Modified Files:
    src/sbbs3/zmodem.c
    Log Message:
    Strip/ignore high (parity) bit in ZPAD, ZDLE, and hex headers

    The previous committed fix/issue raised some additional concerns about this "parity" bit:

    Something I didn't notice before from the ZMODEM spec:
    "The hex header receiving routine ignores parity."

    And looking at lrzsz's zm.c, I see it goes even further and ignores the "parity" bit on the ZPAD and ZDLE bytes proceeding the frame encoding byte as well as in the frame encoding byte itself (so ZHEX, 'B' 0x22 and 0xC2 should be treated as equivalent).

    I find it strange that some ZMODEM implementations (e.g. chuck's zshhdr()) would send the terminating LF with the even-parity bit set, but not set the even-parity flag for any of the frame content bytes. And then, expect that the parity flag may be set on incoming hex headers. I suppose it makes sense for 7-E-1 connections, but then the transmitted terminating LF would have had its parity flag set automatically (would not need to be set manually in the code). Add to the mysteries of ZMODEM that will likely never be solved.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Thu Apr 28 14:05:48 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/3bfa626d494d44afd5d6e32a
    Modified Files:
    src/sbbs3/zmodem.c
    Log Message:
    Fix erroneous error message

    Subpacket OVERFLOW means received subpacket byte offset is >= the max subpacket length.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (in GitKraken)@VERT to Git commit to main/sbbs/master on Thu Feb 16 00:01:50 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/b4e181688c06a2a05280947f
    Modified Files:
    src/sbbs3/zmodem.c
    Log Message:
    64-bit free disk space fix

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Thu Jan 2 17:40:12 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/57e0d22816044e34efcf7e0d
    Modified Files:
    src/sbbs3/zmodem.c
    Log Message:
    Resolve newly added MSVC warning

    warning C4244: 'return': conversion from 'uint64_t' to 'unsigned int',
    possible loss of data

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Fri Jan 3 11:46:22 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/d2cd0a651384b4c6f9ccfd3a
    Modified Files:
    src/sbbs3/zmodem.c
    Log Message:
    Ok, so the real issue Coverity has is the tainting of nX.

    Have zmodem_recv_nibble() explicitly range-check all values, and
    handle negative values. If this remains an issue, it can be
    untainted with range checks on each nibble, but let's not go there
    to start with.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Sat Jan 4 00:52:27 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/35f2ec2f73a22d3b7702787a
    Modified Files:
    src/sbbs3/zmodem.c
    Log Message:
    So, Coverity knows that won't happen, so that just creates a new issue

    Try untainting it in recv_hex... if that doesn't work, I'll just
    have to ignore it I guess.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Sat Jan 4 01:51:54 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/8be9b414e85a30b6da2cdb06
    Modified Files:
    src/sbbs3/zmodem.c
    Log Message:
    Yep, Coverity knows those won't do anything.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Sat Jan 4 13:36:34 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/f5db57c486e22411d71e861c
    Modified Files:
    src/sbbs3/zmodem.c
    Log Message:
    Suppress Coverity overflow issue.

    This can't actually happen.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Sat Jan 4 16:19:54 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/430f50363dcd4db76e06906d
    Modified Files:
    src/sbbs3/zmodem.c
    Log Message:
    So, Coverity knows that won't happen, so that just creates a new issue

    Try untainting it in recv_hex... if that doesn't work, I'll just
    have to ignore it I guess.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Sat Jan 4 16:19:54 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/6ab3066724eee2426b2c2480
    Modified Files:
    src/sbbs3/zmodem.c
    Log Message:
    Yep, Coverity knows those won't do anything.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Sat Jan 4 16:19:54 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/02a684faf4f89b31d450d02c
    Modified Files:
    src/sbbs3/zmodem.c
    Log Message:
    Suppress Coverity overflow issue.

    This can't actually happen.

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