• src/xpdev/str_list.c

    From rswindell@VERT to CVS commit on Fri Mar 20 12:29:53 2020
    src/xpdev str_list.c 1.54 1.55
    Update of /cvsroot/sbbs/src/xpdev
    In directory cvs:/tmp/cvs-serv32324

    Modified Files:
    str_list.c
    Log Message:
    The Borland C++/C++Builder (6) that I'm still using doesn't have asprintf() or the necesary functions for a re-implementation of asprintf().


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Wed Apr 22 23:58:43 2020
    src/xpdev str_list.c 1.57 1.58
    Update of /cvsroot/sbbs/src/xpdev
    In directory cvs:/tmp/cvs-serv3872

    Modified Files:
    str_list.c
    Log Message:
    Avoid some NULL dereferences when passed NULL str_list_t args.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Mon May 25 19:46:15 2020
    src/xpdev str_list.c 1.60 1.61
    Update of /cvsroot/sbbs/src/xpdev
    In directory cvs:/tmp/cvs-serv16156

    Modified Files:
    str_list.c
    Log Message:
    Fix strListDedupe() - if a string is removed (cause it was a dupe), don't increment the second loop counter or you'll skip past the NULL-terminator.


    ---
    þ 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