summaryrefslogtreecommitdiff
path: root/pjlib/include
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-04-02 18:36:35 +0000
committerBenny Prijono <bennylp@teluu.com>2008-04-02 18:36:35 +0000
commitd5dde7220f5a2c773087f4dcd85119dfde2af79e (patch)
treed0b6ed920937a0feaf018db84e07f739ccad9c58 /pjlib/include
parentac825cc6c3d5bdd055d29379520fb8b3c91212e3 (diff)
Ticket #520: Race condition may cause ioqueue corruption (thanks Philippe Leuba)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1905 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/include')
-rw-r--r--pjlib/include/pj/list_i.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/pjlib/include/pj/list_i.h b/pjlib/include/pj/list_i.h
index b604d790..5701381f 100644
--- a/pjlib/include/pj/list_i.h
+++ b/pjlib/include/pj/list_i.h
@@ -75,6 +75,12 @@ PJ_IDEF(void) pj_list_merge_first(pj_list_type *lst1, pj_list_type *lst2)
PJ_IDEF(void) pj_list_erase(pj_list_type *node)
{
pj_link_node( ((pj_list*)node)->prev, ((pj_list*)node)->next);
+
+ /* It'll be safer to init the next/prev fields to itself, to
+ * prevent multiple erase() from corrupting the list. See
+ * ticket #520 for one sample bug.
+ */
+ pj_list_init(node);
}