avl: guard against theoretical null pointer dereference
authorPetr Štetiar <ynezz@true.cz>
Wed, 20 Nov 2019 08:31:08 +0000 (09:31 +0100)
committerPetr Štetiar <ynezz@true.cz>
Sun, 24 Nov 2019 12:26:58 +0000 (13:26 +0100)
commit9b6ede0e5312071400e6b009c6b92413061bbfaa
tree0eb55dc93de5f81a5f7984562466d1a1ea3738b5
parentc008294a8323c8cd45decde6a97aa85df2443dac
avl: guard against theoretical null pointer dereference

clang-10 analyzer reports following:

 avl.c:671:25: warning: Access to field 'parent' results in a dereference of a null pointer (loaded from field 'right')
     node->right->parent = parent;
           ~~~~~         ^

Which seems to be impossible to trigger via exported AVL public API, but
it could be probably trigerred by fiddling with the AVL tree node struct
members manually as they are exposed.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
avl.c