]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
correctly limit hash resize to RBTDB_GLUE_TABLE_MAX_BITS
authorEvan Hunt <each@isc.org>
Fri, 3 Nov 2023 12:37:51 +0000 (13:37 +0100)
committerEvan Hunt <each@isc.org>
Wed, 6 Dec 2023 19:45:19 +0000 (11:45 -0800)
Use < instead of <= when testing the new new hash bits size,
otherwise it can exceed the limit.

(cherry picked from commit 8f7381446903133a407ea6ee30aa12a3536b8af3)

lib/dns/rbtdb.c

index 207f7152653631e7ebfc73257e1a469871fe9ab0..fbb4b84259a8dbaccf0639879805c32871489f10 100644 (file)
@@ -10070,7 +10070,7 @@ rehash_bits(rbtdb_version_t *version, size_t newcount) {
        uint32_t newbits = oldbits;
 
        while (newcount >= HASHSIZE(newbits) &&
-              newbits <= RBTDB_GLUE_TABLE_MAX_BITS)
+              newbits < RBTDB_GLUE_TABLE_MAX_BITS)
        {
                newbits += 1;
        }