• src/sbbs3/writemsg.cpp

    From rswindell@VERT to CVS commit on Tue May 12 23:40:20 2020
    src/sbbs3 writemsg.cpp 1.173 1.174
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv11411

    Modified Files:
    writemsg.cpp
    Log Message:
    Use binary mode when creating quotes.txt to eliminate excessive carriage return characters on Windows.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sun May 24 12:34:02 2020
    src/sbbs3 writemsg.cpp 1.174 1.175
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv28131

    Modified Files:
    writemsg.cpp
    Log Message:
    Fix heap corruption resulting from use of internal message editor "/E" (edit line) command when extended a line of text to a length longer than what was allocated.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to sbbs/master on Wed Oct 21 18:32:09 2020
    https://gitlab.synchro.net/sbbs/sbbs/-/commit/eb209e8495db39e7732696fc
    Modified Files:
    src/sbbs3/writemsg.cpp
    Log Message:
    Do not remove trailing white-space from lines in .sig files

    This allows a .sig file to contain "\n-- \n", the "standard" USENET signature delimiter, as requested by Tracker1.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Wed Dec 9 02:02:49 2020
    https://gitlab.synchro.net/main/sbbs/-/commit/97ac3bbf7720b3940d3f3198
    Modified Files:
    src/sbbs3/writemsg.cpp
    Log Message:
    Parse/separate forward-to-netmail name from address

    Only do the local user notification when appropriate.
    Signal the FTN netmail semaphore when appropriate.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Fri Mar 5 20:41:25 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/3e999815c58affc0eefcf7fb
    Modified Files:
    src/sbbs3/writemsg.cpp
    Log Message:
    Don't allow subject to be changed when forwarding file attachments

    Since the filename is in the subject, we can't allow the user to change the subject (duh). Also, don't bother with the "Fwd:" prefix thing as that could potentially cause problems in other places where the filename (only) is assumed to be in the subject.

    Also, make sure to create the destination directory when moving file attachments. These changes fix issue #230 reported by Keyop.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sat Mar 13 12:48:15 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/5b044471b7f5dd69840fcb04
    Modified Files:
    src/sbbs3/writemsg.cpp
    Log Message:
    Fix error removing INPUT.MSG introduced in Commit 0c441424

    remove() is expected to fail in this scenario sometimes depending
    on how writemsg() is used - in the error case, the user was trying
    to edit his .plan file with the ;plan command:
    term Node 10 <Deuce> !ERROR 11 (Resource temporarily unavailable) in writemsg.cpp line 1232 (editfile) removing "/sbbs/node10/temp/INPUT.MSG" access=0

    Thanks for the bug report!

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Wed Mar 31 23:56:36 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/1f805a5d3f87786be3c576cd
    Modified Files:
    src/sbbs3/writemsg.cpp
    Log Message:
    Fix editmsg() always fails bug introduced in commit 0c441424

    Another Coverity-issued-fixed-introduced-bug.

    Failure to remove a non-existant file is not reason for failure.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sun Apr 25 19:36:21 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/1139cfe5ab831096a0b94cef
    Modified Files:
    src/sbbs3/writemsg.cpp
    Log Message:
    Fix double close (fnopen doesn't leave the descriptor open)

    Fixes CID 33724.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Tue Aug 17 23:49:55 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/4d01818374e0bb40b1fa15ba
    Modified Files:
    src/sbbs3/writemsg.cpp
    Log Message:
    When writing/reading quotes.txt, ignore first 2 lines if WWIV-type

    WWIV writes 2 lines of metadata to the beginning of its quotes.txt file created for external message editors. Its not clear yet what these lines should contain, but the first line apparently should contain a '#' character since BREdit checks for this character before deciding to throw-away/ignore these lines (don't use them for quoted text). Thanks mlong for this tip!

    So if the external editor is set to "WWIV CHAIN.TXT" in SCFG (even if the door doesn't need/use it), then the quotes.txt file created by Synchronet will contain the extra 2 lines. We're just writing a # to the first line and the second line is blank.

    This fixes reported issue #188.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Wed Mar 2 13:25:51 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/b47b97c2602bdd784b0f63dc
    Modified Files:
    src/sbbs3/writemsg.cpp
    Log Message:
    Detect smb_[f]allocdat() failure in editmsg()

    CID 319091

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Wed Mar 2 18:14:50 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/bb18309c7f0cde12745b44ff
    Modified Files:
    src/sbbs3/writemsg.cpp
    Log Message:
    Fix CID 33239: Argument cannot be negative

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sun Mar 13 00:18:52 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/da406c0a793ce998e982dd88
    Modified Files:
    src/sbbs3/writemsg.cpp
    Log Message:
    Fix CID 33235: Argument cannot be negative

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sun Jul 3 15:55:50 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/2db618ae2da445cf21a420c5
    Modified Files:
    src/sbbs3/writemsg.cpp
    Log Message:
    Fix smb.subnum corruption in writemsg()

    Fix issue introduced 9 years ago that could cause a crash after replying to a post via email or netmail and then displaying the header of a poll message or a normal message with votes:

    Program terminated with signal SIGSEGV, Segmentation fault.
    #0 0x00007f9f9569a317 in sbbs_t::show_msg (this=0x7f9f70c56880,
    smb=0x7f9f70c5e4e0, msg=0x7f9ebadf08b0, p_mode=4, post=0x7f9f18071a24)
    at getmsg.cpp:255
    255 ,cfg.sub[smb->subnum]->misc&SUB_ NAME ? useron.name : useron.alias, NET_NONE, NULL);
    [Current thread is 1 (Thread 0x7f9ebadf3700 (LWP 23279))]
    (gdb) print smb->subnum
    $1 = 4294967295
    (gdb) bt
    #0 0x00007f9f9569a317 in sbbs_t::show_msg (this=0x7f9f70c56880,
    smb=0x7f9f70c5e4e0, msg=0x7f9ebadf08b0, p_mode=4, post=0x7f9f18071a24)
    at getmsg.cpp:255
    #1 0x00007f9f957b2aee in sbbs_t::scanposts (this=0x7f9f70c56880, subnum=9,
    mode=2, find=0x7f9ebadf1270 "") at readmsgs.cpp:670
    #2 0x00007f9f957bb75a in sbbs_t::scanallsubs (this=0x7f9f70c56880, mode=2)
    at scansubs.cpp:219
    #3 0x00007f9f9568c948 in sbbs_t::exec_msg (this=0x7f9f70c56880,
    csi=0x7f9f70c64768) at execmsg.cpp:315
    #4 0x00007f9f95683129 in sbbs_t::exec_function (this=0x7f9f70c56880,
    csi=0x7f9f70c64768) at execfunc.cpp:422
    #5 0x00007f9f95679450 in sbbs_t::exec (this=0x7f9f70c56880,
    csi=0x7f9f70c64768) at exec.cpp:1199
    #6 0x00007f9f9577d742 in node_thread (arg=0x7f9f70c56880) at main.cpp:4364

    writemsg() was changing the global smb.subnum and when writing an email or netmail, that subnum value is -1 (since it's not a sub-board) and then later show_msg() is using the smb.subnum as a index into scfg.sub[] when determining if the current user already voted on the message being displayed and then: bang, crash, fall down, go boom.

    Simply saving and restoring the smb.subnum when executing an external editor is all that was needed here. And this is the first use of the C++ "auto" keyword in Synchronet!

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