]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
reset "chunk" to ensure we find the correct entry
authorAlan T. DeKok <aland@freeradius.org>
Mon, 1 Oct 2018 13:17:16 +0000 (09:17 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 1 Oct 2018 13:17:38 +0000 (09:17 -0400)
src/lib/util/trie.c

index 3465caf68639d23b999c4851e2f5b158e0a0532d..a9d570fe1dcb0aa148c356eafbaa462a6e2d5736 100644 (file)
@@ -1756,6 +1756,7 @@ static void *fr_trie_key_remove(fr_trie_t *ft, TALLOC_CTX *ctx, void **parent_p,
                if (node->used == 1) {
                        int i;
                        void *trie;
+                       chunk = -1;
 
                        for (i = 0; i < (1 << node->size); i++) {
                                if (node->trie[i]) {
@@ -1765,6 +1766,8 @@ static void *fr_trie_key_remove(fr_trie_t *ft, TALLOC_CTX *ctx, void **parent_p,
                        }
 
                        fr_cond_assert(i < (1 << node->size));
+                       fr_cond_assert(chunk >= 0);
+                       fr_cond_assert(chunk < (1 << node->size));
 
                        /*
                         *      Convert the node to a PATH.