• src/sbbs3/postmsg.cpp

    From Rob Swindell@VERT to Git commit to main/sbbs/master on Thu Mar 18 21:24:40 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/54c935707ff58e948fb0df2b
    Modified Files:
    src/sbbs3/postmsg.cpp
    Log Message:
    Move the tags prompt to *before* the locking of the message base

    Thanks Mr. Executive Chicken esq. for the telephone call and bug report.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sun Apr 4 15:13:57 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/489267ade424d4f40cf8b752
    Modified Files:
    src/sbbs3/postmsg.cpp
    Log Message:
    mod_ar is no longer a pointer, it's an array

    CID 319077

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Tue Apr 13 20:20:22 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/908618c85f29a300acc7a500
    Modified Files:
    src/sbbs3/postmsg.cpp
    Log Message:
    Debug the "thread_back field missing" error

    Some QWKnet vote messages are failing:
    evnt unpackREP <ENSEMBLE> !ERROR 2 (No such file or directory) in qwk.cpp line 1146 (qwk_vote) writing "/sbbs/data/subs/dove-gen" access=-105 info=smb_addvote thread_back field missing

    Catch this problem a little higher up (in votemsg()) and log the message's reply-IDs to help determine what's the root-cause here. Don't bother calling smb_addvote() if thread_back is 0.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Mon Oct 24 15:49:30 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/33a8b69cfbbd8194e3519608
    Modified Files:
    src/sbbs3/postmsg.cpp
    Log Message:
    Strip control chars/ctrl-A sequences from msg subject in notify()

    We may want Ctrl-A sequences in the telegram subject, but not in the message subject

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows)@VERT to Git commit to main/sbbs/master on Sun May 7 23:22:44 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/4a86ab8768e486a58d22d55e
    Modified Files:
    src/sbbs3/postmsg.cpp
    Log Message:
    Bounds-check subnum in savemsg()

    It's possible to use savemsg() (from JS MsgBase.save_msg()) to add a message
    to a message base that's not a sub-board (not configured in SCFG->Message
    Areas and not the "mail" base), but in that case, savemsg() would dereference an invalid sub in the scfg->sub array and crash. So use is_valid_subum()
    to insure the subnum is a valid sub before using as an index.

    ---
    ■ 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 Mon Dec 9 19:15:31 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/69111a8f420d212de3c0d638
    Modified Files:
    src/sbbs3/postmsg.cpp
    Log Message:
    If user doesn't modify the replied-to-msg subject, use the original subject

    (which might be UTF-8 encoded). This works-around the problem that Accession reported in #synchronet with my reply to a UTF-8 encoded message using a CP437 terminal which resulted in a message body that was UTF-8 encoded but a message subject that was CP437 encoded. This mix of encodings is not supported by FTN standards.

    This is just a work-around since if the user modifies the subject the result could still have the CP437 unside-down question marks (indicating non-translatable UNICODE chars) and those should be converted to UTF-8
    chars when going out on FTN or being stored in the message base. So there's still a bug here somewhere that I need to look into more.

    ---
    ■ 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 Sun Jan 5 21:06:01 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/1dde501fe8ea8dc8bea5e3d4
    Modified Files:
    src/sbbs3/postmsg.cpp
    Log Message:
    Call add_msg_id() *after* opening the message base to send notification email

    notify() was creating wrongly-formated auto-generated Message-IDs:
    e.g. Message-ID: <677B3F17.0.notices@vert.synchro.net>

    ---
    ■ 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 Tue May 20 20:29:15 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/7ea01b60689e299a8a9dd131
    Modified Files:
    src/sbbs3/postmsg.cpp
    Log Message:
    Refactor/order the handling of reply-to-message header data

    Fix CID 551210

    There should not be any change in behavior here other than eliminating a potential null pointer dereference.

    ---
    ■ 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 Mar 5 21:35:23 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/71ee93e8e5e12eec270960d6
    Modified Files:
    src/sbbs3/postmsg.cpp
    Log Message:
    Fix typo in comment (only)

    ---
    ■ 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 May 14 01:58:37 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/e5ddda76d568b467f45c1ee2
    Modified Files:
    src/sbbs3/postmsg.cpp
    Log Message:
    postmsg: fix segfault in savemsg/votemsg for ad-hoc (is_path) MsgBases

    savemsg() and votemsg() both unconditionally dereferenced
    cfg->sub[smb->subnum] when posting the "MsgPostedToYou" / vote
    notification text — gated only by the subnum != INVALID_SUB check, not
    by subnum_is_valid(). For an "is_path" MsgBase (created from JS as
    "new MsgBase(path, true)"), js_msgbase_constructor sets
    smb.subnum = scfg->total_subs (intentionally not INVALID_SUB so it
    isn't treated as the mail base), which is one past the end of the
    cfg->sub[] array. The deref was a guaranteed segfault whenever a
    to_ext-tagged message was saved/voted on into such a base.

    Reproducer (against any Synchronet install, via jsexec):
    var p = system.temp_dir + "tmp_" + Date.now();
    var mb = new MsgBase(p, true); mb.open();
    mb.save_msg({to:"x", to_ext:"1", from:"y", subject:"z"}, "body");
    // -> SIGSEGV inside savemsg, after smb_addmsg() succeeds

    The crashing path: msg has to_ext set and resolves to a real local
    user (usernum > 0); subnum != INVALID_SUB so the else-branch fires;
    that branch formats cfg->text[MsgPostedToYouVia] using cfg->grp[cfg->sub[subnum]->grp]->sname and cfg->sub[subnum]->lname.
    With subnum == total_subs both reads are out of bounds.

    Fix: gate the else branch in savemsg on subnum_is_valid(), and add the
    same guard to the entire vote-notification block in votemsg. When the
    sub isn't a known sub-board (is_path / ad-hoc msgbase), skip the local
    "you have a message" putsmsg notification — there's no sub/grp metadata
    to format the standard text against, and the JS caller didn't ask for
    sub-board side effects.

    The unguarded deref itself dates back further, but it became reachable
    when commit 93b4d946c ("Security improvements to MsgBase and FileBase constructors") added the "is_path=true" constructor option that sets
    subnum = total_subs.

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