• src/xpdev/link_list.c

    From rswindell@VERT to CVS commit on Tuesday, March 11, 2014 22:34:23
    src/xpdev link_list.c 1.53 1.54
    Update of /cvsroot/sbbs/src/xpdev
    In directory cvs:/tmp/cvs-serv12220

    Modified Files:
    link_list.c
    Log Message:
    Fixed bug discovered by Noel Romey on Windows: when listFree() is called with
    a linked list which had previously been freed, it would try to destroy the mutex (Win32 critical section) which had already been destroyed and cause a crash. Clear the LIST_MUTEX (and LIST_SEMAPHORE) flags after freeing those resources to prevent this double-free issue.
    This bug was apparently triggered by the web server (listFree(&log_list) in cleanup()) because cleanup() can be called in some recycle failure cases
    (e.g. ports cannot rebind) *before* listInit() is called. Some *other* error following a recycle must preced this bug/crash.

    Thanks to Noel for helping with the debugging (capturing callstack with MSVC).


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From deuce@VERT to CVS commit on Thursday, February 12, 2015 03:03:12
    src/xpdev link_list.c 1.54 1.55
    Update of /cvsroot/sbbs/src/xpdev
    In directory cvs:/tmp/cvs-serv20180

    Modified Files:
    link_list.c
    Log Message:
    Fix use-after-free bug in listRemoveNodes()




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From rswindell@VERT to CVS commit on Wednesday, February 18, 2015 00:32:05
    src/xpdev link_list.c 1.55 1.56
    Update of /cvsroot/sbbs/src/xpdev
    In directory cvs:/tmp/cvs-serv13181

    Modified Files:
    link_list.c
    Log Message:
    listLock() and listUnlock() would return FALSE on mutex-protected linked-lists if the lock or unlock operation was successful (the opposite of the expectation of the BOOL return value).
    The current callers of these functions are not checking the return value, so no actual observable bug is fixed with this commit. These are not the bug-fixes you are looking for.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From rswindell@VERT to CVS commit on Sunday, February 25, 2018 21:22:07
    src/xpdev link_list.c 1.58 1.59
    Update of /cvsroot/sbbs/src/xpdev
    In directory cvs:/tmp/cvs-serv19961

    Modified Files:
    link_list.c
    Log Message:
    Allow link_list.c to built without str_list support.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Thursday, March 08, 2018 18:40:03
    src/xpdev link_list.c 1.59 1.60
    Update of /cvsroot/sbbs/src/xpdev
    In directory cvs:/home/rswindell/sbbs/src/xpdev

    Modified Files:
    link_list.c
    Log Message:
    Use the function pthread_mutex_initializer_np() in place of the macro (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP) - when we defined _GNU_SOURCE, assigning that macro value to list->mutex triggers a GCC compiler error.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From deuce@VERT to CVS commit on Thursday, March 08, 2018 23:46:03
    src/xpdev link_list.c 1.60 1.61
    Update of /cvsroot/sbbs/src/xpdev
    In directory cvs:/tmp/cvs-serv26352

    Modified Files:
    link_list.c
    Log Message:
    Allow passing LAST_NODE to listRemoveNodes() for people who don't know that listRemoveNode() exists.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Friday, August 02, 2019 06:07:54
    src/xpdev link_list.c 1.62 1.63
    Update of /cvsroot/sbbs/src/xpdev
    In directory cvs:/tmp/cvs-serv27457

    Modified Files:
    link_list.c
    Log Message:
    Still building this lib with the pre-C99 Borland C++, so deal.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sunday, August 04, 2019 12:38:53
    src/xpdev link_list.c 1.63 1.64
    Update of /cvsroot/sbbs/src/xpdev
    In directory cvs:/tmp/cvs-serv25927

    Modified Files:
    link_list.c
    Log Message:
    Still building this lib with the pre-C99 Borland C++, so deal more.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¨@VERT to Git commit to main/sbbs/master on Thursday, February 15, 2024 13:15:37
    https://gitlab.synchro.net/main/sbbs/-/commit/44afa1b3c4231a1d291fcfa7
    Modified Files:
    src/xpdev/link_list.c
    Log Message:
    Don't hold a mutex while it's destroyed.

    Found by Coverity.
    If there's actually another thread using the list when the refcount
    hits zero, you're going to have a bad time regardless of the lock.

    Coverity has been pointing this out for a while, but we've been
    ignoring it as a false positive.

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