From b655041650f496fc7367e2c5140c5835507b9e73 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 13 Aug 2020 23:50:56 +0200 Subject: Fix potential null pointer dereference --- zix/btree.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'zix') diff --git a/zix/btree.c b/zix/btree.c index 0300523..c81b283 100644 --- a/zix/btree.c +++ b/zix/btree.c @@ -661,6 +661,9 @@ zix_btree_lower_bound(const ZixBTree* const t, if (!t) { *ti = NULL; return ZIX_STATUS_BAD_ARG; + } else if (!t->root) { + *ti = NULL; + return ZIX_STATUS_SUCCESS; } ZixBTreeNode* n = t->root; -- cgit v1.2.1