From d292fd3756933049e56dc10597b12a2200664ba2 Mon Sep 17 00:00:00 2001 From: Zachary Dremann Date: Wed, 26 Jun 2024 22:16:18 -0400 Subject: [PATCH] art_iterator_lower_bound works on empty bitmap64 When we reset the iterator to the root, check if the root is null --- src/art/art.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/art/art.c b/src/art/art.c index 835699146..dc2f17a5d 100644 --- a/src/art/art.c +++ b/src/art/art.c @@ -1693,8 +1693,11 @@ bool art_iterator_lower_bound(art_iterator_t *iterator, // a valid key. Start from the root. iterator->frame = 0; iterator->depth = 0; - return art_node_iterator_lower_bound(art_iterator_node(iterator), - iterator, key); + art_node_t *root = art_iterator_node(iterator); + if (root == NULL) { + return false; + } + return art_node_iterator_lower_bound(root, iterator, key); } int compare_result = art_compare_prefix(iterator->key, 0, key, 0, ART_KEY_BYTES);