From bbf0b907cb04184515d0f5f09f14824df1c2e59f Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Fri, 5 Aug 2016 16:38:45 +1000 Subject: [PATCH] ctdb-common: Fix CID 1125583 Dereference after null check (FORWARD_NULL) This also fixes CID 1125584. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12110 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/common/rb_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctdb/common/rb_tree.c b/ctdb/common/rb_tree.c index f4aee8bf2b8..c3b2b91e3b0 100644 --- a/ctdb/common/rb_tree.c +++ b/ctdb/common/rb_tree.c @@ -223,7 +223,7 @@ static inline void trbt_set_color(trbt_node_t *node, int color) } static inline void trbt_set_color_left(trbt_node_t *node, int color) { - if ( ((node==NULL)||(node->left==NULL)) && (color==TRBT_BLACK) ) { + if (node == NULL || node->left == NULL) { return; } node->left->rb_color = color; -- 2.47.2