• src/smblib/smbtxt.c

    From Rob Swindell (on ChromeOS)@VERT to Git commit to main/sbbs/master on Thursday, February 19, 2026 23:08:52
    https://gitlab.synchro.net/main/sbbs/-/commit/685cbb887a04725dc4935e19
    Modified Files:
    src/smblib/smbtxt.c
    Log Message:
    Confirm SDT FILE* is non-null

    Bug occurred where this function was called with a zeroed-out smb_t and it was not handled gracefully (got an exception in stdio functions because of the
    NULL std_ftp) - so handle it as gracefully as we can here.

    Most bugs have 2 causes...

    ---
    þ 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 Wednesday, July 29, 2026 21:24:17
    https://gitlab.synchro.net/main/sbbs/-/commit/2b8e4cf5aaecfb834c50772f
    Modified Files:
    src/smblib/smbtxt.c
    Log Message:
    smblib: decode MIME attachments in nested multipart messages

    The boundary= parameter value was terminated only by ';' or a closing
    quote, never by the end of the header line. That is harmless for the
    top-level Content-Type, which comes from a NUL-terminated header field,
    but a nested part's Content-Type is a pointer into the raw message body:
    when boundary= is the last parameter on its folded line - what iOS Mail
    emits - every following header and body byte was swallowed into the
    boundary string, so no delimiter ever matched.

    Nested parts therefore yielded no attachments at all, and
    smb_getplaintext() could fail on the same messages, leaving the Terminal
    Server to display the entire raw MIME body - base64 and all - instead of
    the readable text.

    Terminate the value at the end of the header line as well, and bound the boundary= search to the part's own (possibly folded) Content-Type field:
    once CRLF terminates a value, an unbounded search would otherwise pick up
    a boundary= appearing later in the message text. Reject an empty
    boundary, which yields the string "--" and so matches the leading dashes
    of every delimiter as well as any "--" in the body. Also skip the white
    space RFC822 permits around the '=', and end an unquoted value at white
    space, which an RFC2046 boundary token cannot contain.

    GitLab #1205

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

    ---
    þ 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 Wednesday, July 29, 2026 21:24:17
    https://gitlab.synchro.net/main/sbbs/-/commit/05168cb2e65c1bf6f7617a39
    Modified Files:
    src/smblib/smbtxt.c
    Log Message:
    smblib: enumerate MIME attachments across nested containers

    smb_getattachment()'s index argument stepped through the parts of a
    single multipart container only: mime_getpart() kept its match counter in
    a local, so every level of the recursion restarted counting at zero. Two sibling containers holding one attachment each therefore yielded only the
    first - index 1 found nothing - and in a message mixing depths, every attachment following the first container was unreachable.

    Share the counter across the whole recursion so that index enumerates
    matching parts in document order regardless of nesting.
    smb_countattachments(), which walks index until it comes up empty, now
    reports the true total rather than stopping at the first gap.

    This was unreachable until the preceding commit, which is what made
    nested containers get descended into at all.

    GitLab #1205

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

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