On Wed, 20 Nov 2019 at 20:01, Petr Štetiar <yn...@true.cz> wrote: > > 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. >
No, theoretically it's still impossible, even if callers fiddled with these internal members before ;) The first check (node->left == NULL && node->right == NULL) if matched, will return. This commit is on 2nd check (node->left == NULL) which implies (node->right != NULL) yousong _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel