• src/xpdev/str_list.c

    From Rob Swindell@VERT to Git commit to main/sbbs/master on Fri Apr 16 12:22:40 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/bef16f429032791c7f485e54
    Modified Files:
    src/xpdev/str_list.c
    Log Message:
    if strListFind() is passed a NULL 'str' value, return -1 (not found)

    Return int value for "string not found" rather than crash/segfault. Seems the better option.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Tue May 4 01:12:22 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/30f63a5c271519872f70285e
    Modified Files:
    src/xpdev/str_list.c
    Log Message:
    NULL pointer checks in strListSort*() and strListDup()

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sat Jan 21 13:15:16 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/a5ed96ee9e9ba0a52ad07bc1
    Modified Files:
    src/xpdev/str_list.c
    Log Message:
    strListJoin() will now fail gracefully (return NULL) if passed NULL buf

    No immediate need/use.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on ChromeOS)@VERT to Git commit to main/sbbs/master on Sat Mar 25 18:46:50 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/b869bf8ca721367548be301d
    Modified Files:
    src/xpdev/str_list.c
    Log Message:
    Fix strListCmp() - apparently never tested

    This function is used in sbbs_ini.c, but was always returnning non-zero, even when both string lists were identical.

    ---
    ■ 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 Sat Sep 21 13:08:41 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/d49134e6f734b94cc1741418
    Modified Files:
    src/xpdev/str_list.c
    Log Message:
    strListReadFile() now returns NULL on any file read failure

    Previously, the partially-read lines would be returned in an allocated
    string list. This is a suspected cause of issue #791: even though the file was successfully opened exclusively (using sopen... SH_DENYRW), it's possible that Samba had already allowed another client or local process to open the same file, but is now a denying read (most likely, the first read). As Deuce
    pointed out, the xpdev *nix implementation of sopen() locks the region/record of the entire file. So before this change, strListReadFile() might fail on
    the first read, and a function that uses iniFileRead() to modify the contents of an ini file, might end up writing back the empty list (with added keys), thus deleting all the existing content of the file.

    Also in this change:
    - Eliminated the unnecessary local/wrapped str_list_read_file() function.
    - Elminate unecessary null-before-free check
    - Fixed potential memory leak upon malloc failure (the potentially-allocated
    list wasn't freed).

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