From d5dde7220f5a2c773087f4dcd85119dfde2af79e Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Wed, 2 Apr 2008 18:36:35 +0000 Subject: 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 --- pjlib/include/pj/list_i.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pjlib/include') 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); } -- cgit v1.2.3