From: Martin Schwenke Date: Fri, 5 Aug 2016 06:37:00 +0000 (+1000) Subject: ctdb-common: Fix CID 1125581 Dereference after null check (FORWARD_NULL) X-Git-Tag: samba-4.3.12~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49211ba72232909a4c44df7a3204dbb57b67fbe4;p=thirdparty%2Fsamba.git ctdb-common: Fix CID 1125581 Dereference after null check (FORWARD_NULL) This also fixes CID 1125582. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12110 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs (cherry picked from commit 7ae3699831427725f12e0a26a0681e59f2fbb2d9) --- diff --git a/ctdb/common/rb_tree.c b/ctdb/common/rb_tree.c index 6b131bc0932..5a5c649a7f1 100644 --- a/ctdb/common/rb_tree.c +++ b/ctdb/common/rb_tree.c @@ -224,7 +224,7 @@ static inline void trbt_set_color_left(trbt_node_t *node, int color) } static inline void trbt_set_color_right(trbt_node_t *node, int color) { - if ( ((node==NULL)||(node->right==NULL)) && (color==TRBT_BLACK) ) { + if (node == NULL || node->right == NULL) { return; } node->right->rb_color = color;