• src/sbbs3/writemsg.cpp

    From Rob Swindell@1:103/705 to Git commit to main/sbbs/master on Wed Mar 2 13:25:50 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
    --- SBBSecho 3.15-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 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
    --- SBBSecho 3.15-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Tue Feb 7 18:11:56 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/208cc78b54ac851645e8cbd1
    Modified Files:
    src/sbbs3/writemsg.cpp
    Log Message:
    Don't save draft messages upon disconnect for Guest or "no one" (user #0)Fix issue #508
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows)@1:103/705 to Git commit to main/sbbs/master on Thu Apr 13 18:45:54 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/ff3864002e9a51e98b1c83f5
    Modified Files:
    src/sbbs3/writemsg.cpp
    Log Message:
    Bounds-check the buffer being written in msgeditor()Replace the suspicious strcpy/strcat's in msgeditor(), the built-in lineeditor, with bounds-enforced snprintf() calls.Also, properly define MAX_LINE_LEN to account for the trailing \r\n on eachline. It appears we've been under allocating the total possible message buffersize (by 2 bytes per line) for a while now.These 2 changes together should fix issue #547: apparent heap corruption dueto 'buf' overflow in msgeditor().Also added a line count check/cap-enforcement with logged error message ifexceeded (should never happen).Also fixed in this commit: off-by-one when enforcing max message length inmsgeditor().Also added checks that the 'cols' (used in MAX_LINE_LEN) are reasonable values(40+), 2 was below the threshold of what would be expected to work sincethere is logic that deducts 4 from cols, for example.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Thu Apr 13 18:47:22 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/84527be03f4d728bafe58f10
    Modified Files:
    src/sbbs3/writemsg.cpp
    Log Message:
    Fix new GCC warning in printf format string.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows)@1:103/705 to Git commit to main/sbbs/master on Fri Apr 14 20:37:52 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/4f9a8b209a160d8fac1fc4a3
    Modified Files:
    src/sbbs3/writemsg.cpp
    Log Message:
    Address a couple of Coverity-reported defectsCID 452331CID 452330
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Thu Dec 21 12:38:44 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/daf8fa55aa08b39bf8b4fc6e
    Modified Files:
    src/sbbs3/writemsg.cpp
    Log Message:
    Fix internal line editor buffer overflow (heap corruption)

    ... wasn't accounting for length of the 'top' buffer (when supplied).

    Also, for raw input mode:
    - flush the input buffer (stray LF) before accepting input
    - turn off raw input mode if run out of bytes (max lines/length reached)

    I was investigating the reported error by Nelgin:
    !ERROR in writemsg.cpp line 1214 (msgeditor) checking
    "max lines (20) exceeded" access=46
    which I was unable to reproduce, when I encountered the issues addressed
    in this commit.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Tue Dec 26 16:04:06 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/3057bcc20148e3d93d1052a5
    Modified Files:
    src/sbbs3/writemsg.cpp
    Log Message:
    Insure uploaded text ends in a new-line

    We were appending .sig files to uploaded text, which may not have ended
    in an LF or CRLF sequence. This fixes that.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Tue Jan 23 18:37:48 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/1321d7f537df2b0eb0c99f33
    Modified Files:
    src/sbbs3/writemsg.cpp
    Log Message:
    When editing a message, pass the proper to/from/subj/area to drop file

    Fixes issue #704 - not just for JS bbs.edit_msg(), but for all uses of the underlying sbbs_t::editmsg() function.

    Replaced one specific comparison of subnum == INVALID_SUB with call to is_valid_subnum() just to be consistent. No functional change there.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Tue Feb 13 20:37:50 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/00afb97cc670fdf3e11aa839
    Modified Files:
    src/sbbs3/writemsg.cpp
    Log Message:
    Improvements to UTF-8 capable external editor support

    1. Add an 8th line to MSGINF (for SlyEdit): the character set expected
    (either "CP437", the default, or "UTF-8") based on the SCFG configuration
    2. Don't apply "Soft-CR" (0x8D) stripping/expansion for UTF-8 editors
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Thu Feb 15 19:24:52 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/0dc20c1f9bf66ae376b0f22d
    Modified Files:
    src/sbbs3/writemsg.cpp
    Log Message:
    If the quotes.txt file doesn't exist with the right case, try any case

    (but prefer the proper/configured case, based on config in SCFG).

    Works around a problem where DDMsgReader always creates QUOTES.TXT (never quotes.txt), but SBBS tries to read in the file with the case it expects.
    This wouldn't be a problem on case-insensitive file systems (Windows).

    Resolves the writemsg.cpp error reported by Nelgin
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Thu Feb 15 21:37:00 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/f894f62108ad3251bfcba84c
    Modified Files:
    src/sbbs3/writemsg.cpp
    Log Message:
    Fix bug in previous commit to this file

    I'm surprised this didn't create a warning somewhere: treating char* as a
    bool!
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Tue Feb 20 23:57:52 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/f754ad9057b0cd076bcf57b1
    Modified Files:
    src/sbbs3/writemsg.cpp
    Log Message:
    Allow UTF-8 sequences in message subjects (passing K_UTF8 to getstr)

    This was the behavior for all string input in SBBS until recently
    (Commit 55ccda6294f82506), with this change, an exception is being
    made for message subjects, but the vast majority of other string
    input is still limited to single-byte (i.e. US-ASCII or CP437)
    characters.

    This should fix issue #720
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Sat Sep 21 13:08:40 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/10beb091cd05d255e3911a80
    Modified Files:
    src/sbbs3/writemsg.cpp
    Log Message:
    Log a file "create" error if process_edited_file() returns a negative value

    I discovered that sbbs_t::editfile() (exposed as JS console.editfile) just silently failed if it couldn't write to the destination file
    (e.g. permission denied by OS).
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Mon Nov 4 17:37:32 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/e3f17e6411aba06d9894b169
    Modified Files:
    src/sbbs3/writemsg.cpp
    Log Message:
    Internal message/line editor improvements

    * Allow left and right arrow keys to move between lines (within reason)
    * Use the K_USEOFFSET getstr() mode flag to keep cursor position when moving
    between lines with arrow keys
    * Be smart about integer padding when /Listing lines with numbers
    * Add range checking (!) and better error reporting for /Lx argument value
    --- SBBSecho 3.21-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)