• src/xpdev/str_list.c

    From deuce@VERT to CVS commit on Wednesday, April 23, 2014 23:19:08
    src/xpdev str_list.c 1.40 1.41
    Update of /cvsroot/sbbs/src/xpdev
    In directory cvs:/tmp/cvs-serv30868

    Modified Files:
    str_list.c
    Log Message:
    Fix crazy big memory leak in new (currently unused) strListCmp() function.




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From rswindell@VERT to CVS commit on Thursday, January 28, 2016 22:39:52
    src/xpdev str_list.c 1.43 1.44
    Update of /cvsroot/sbbs/src/xpdev
    In directory cvs:/tmp/cvs-serv30263

    Modified Files:
    str_list.c
    Log Message:
    strListInsert() will now initialize the string list if it's uninitialized (NULL).
    strListCombine() will now return an empty string rather than NULL if passed an uninitialized string list (NULL).


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From deuce@VERT to CVS commit on Friday, January 29, 2016 12:02:22
    src/xpdev str_list.c 1.44 1.45
    Update of /cvsroot/sbbs/src/xpdev
    In directory cvs:/tmp/cvs-serv7418

    Modified Files:
    str_list.c
    Log Message:
    Unfuck previous commit... don't try memset()ing NULL pointers.

    Fixes crash on startup (from sbbs_ini.c:283).




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From deuce@VERT to CVS commit on Friday, January 29, 2016 12:09:04
    src/xpdev str_list.c 1.45 1.46
    Update of /cvsroot/sbbs/src/xpdev
    In directory cvs:/tmp/cvs-serv7631

    Modified Files:
    str_list.c
    Log Message:
    Actually, given the commit message for 1.44, this may be what was intended.




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From deuce@VERT to CVS commit on Thursday, March 08, 2018 22:05:45
    src/xpdev str_list.c 1.47 1.48
    Update of /cvsroot/sbbs/src/xpdev
    In directory cvs:/tmp/cvs-serv14238

    Modified Files:
    str_list.c
    Log Message:
    Fix a pair of unlikely memory leaks on realloc() failure found by scan-build.




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From deuce@VERT to CVS commit on Thursday, March 08, 2018 22:11:37
    src/xpdev str_list.c 1.48 1.49
    Update of /cvsroot/sbbs/src/xpdev
    In directory cvs:/tmp/cvs-serv15140

    Modified Files:
    str_list.c
    Log Message:
    Fix bug in last commit.




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Saturday, December 29, 2018 18:09:49
    src/xpdev str_list.c 1.49 1.50
    Update of /cvsroot/sbbs/src/xpdev
    In directory cvs:/tmp/cvs-serv20463

    Modified Files:
    str_list.c
    Log Message:
    strListFree() will no longer try to dereference the pointer argument if it's NULL.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Friday, February 08, 2019 15:35:41
    src/xpdev str_list.c 1.51 1.52
    Update of /cvsroot/sbbs/src/xpdev
    In directory cvs:/tmp/cvs-serv20015

    Modified Files:
    str_list.c
    Log Message:
    Fix Borland C (5.6, not C99 compliant) build issue introduced in previous commit.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Thursday, February 14, 2019 01:48:25
    src/xpdev str_list.c 1.52 1.53
    Update of /cvsroot/sbbs/src/xpdev
    In directory cvs:/tmp/cvs-serv31705

    Modified Files:
    str_list.c
    Log Message:
    Fix potential for heap corruption in (new function) strListModifyEach():
    If the modify callback function returned a pointer *within* the list item's allocated buffer, the strcpy() would copy from potentialy free'd memory as realloc may change the location of the heap buffer when resizing.
    Fixed by allocating a copy of the returned pointer before freeing the original list item buffer and then just assign the allocated pointer (no copying needed). This likely will result in more heap fragmentation for modified list items are now newly-allocated buffers rather than reallocated existing buffers but the other option would have been to allocate a temporary copy of the string before reallocating and then copying and that would've been a lot more overhead than with this approach.

    This likely fixes any crashes seen in recent revs of v3.17c (e.g. when
    imported QWK or REP packets and text/*.can and the twitlist.cfg are parsed). The sighting on Vertrauen was only in the Windows build and appeared when importing QWK/REP packets.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Friday, March 20, 2020 12:29:53
    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 Wednesday, April 22, 2020 23:58:43
    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 Monday, May 25, 2020 19:46:15
    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@VERT to Git commit to main/sbbs/master on Friday, April 16, 2021 12:22:40
    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 Tuesday, May 04, 2021 01:12:22
    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 Saturday, January 21, 2023 13:15:16
    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 Saturday, March 25, 2023 18:46:50
    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