diff options
author | Benny Prijono <bennylp@teluu.com> | 2008-04-02 18:36:35 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2008-04-02 18:36:35 +0000 |
commit | d5dde7220f5a2c773087f4dcd85119dfde2af79e (patch) | |
tree | d0b6ed920937a0feaf018db84e07f739ccad9c58 /pjlib/include | |
parent | ac825cc6c3d5bdd055d29379520fb8b3c91212e3 (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.h | 6 |
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); } |