Fixes:
lib/util/rbtree.c:170:8: warning: Access to field 'rb_parent_color' results in a dereference of a null pointer (loaded from variable 'other') <--[clang]
We could avoid accessing the NULL pointer but previously the code would
have crashed here. Given this is a rbtree probably better to preserve the
fatal nature of encountering a NULL pointer here while satisfying the static
checker.
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer gary@catalyst.net.nz
#include "replace.h"
#include "rbtree.h"
+#include "fault.h"
#define RB_RED 0
#define RB_BLACK 1
if (parent->rb_left == node)
{
other = parent->rb_right;
+ if (other == NULL) {
+ /* we should never get here */
+ smb_panic("corrupted rb tree");
+ /* satisfy static checkers */
+ return;
+ }
if (rb_is_red(other))
{
rb_set_black(other);