rb_tree: fix possible access-after-free-error in trbt_traversearray32_node
authorMichael Adam <obnox@samba.org>
Thu, 22 Dec 2011 17:09:36 +0000 (18:09 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 12 Jan 2012 07:50:31 +0000 (08:50 +0100)
commit99185969ea0bd298e11408f526b07ff1435caa9c
treec519a04c1c52dad09d68731b2eafddf68f2d3503
parent85c90854c70023e966aba7ef63de83153d29005c
rb_tree: fix possible access-after-free-error in trbt_traversearray32_node

When the traverse callback frees the current node, the traverse of the
rbtree can fail (the next node->right fails since node is not there any more...).
This is fixed by introducing variables to store the right (and left)
pointers before the callback is called.
(cherry picked from commit 8b0caaeed154d26c67a73659d3bbbdd63b21be11)
common/rb_tree.c