]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
ADB entries could be unlinked too soon
authorEvan Hunt <each@isc.org>
Tue, 12 Apr 2022 00:29:03 +0000 (17:29 -0700)
committerEvan Hunt <each@isc.org>
Tue, 12 Apr 2022 00:29:03 +0000 (17:29 -0700)
due to a typo in the code, ADB entries were unlinked from their entry
buckets during shutdown if they had a nonzero reference count. they
were only supposed to be unlinked if the reference count was exactly
one (that being the reference held by the bucket itself).

lib/dns/adb.c

index ae616710a41f37e8ee6e443bdd10f6784da2f755..edce5bf18c8db5eb16f21a389b66d0f20d7d1d7a 100644 (file)
@@ -1009,7 +1009,7 @@ shutdown_entries(dns_adb_t *adb) {
                         * entries not in use.
                         */
                        next_entry = ISC_LIST_NEXT(entry, plink);
-                       if (isc_refcount_current(&entry->references) &&
+                       if (isc_refcount_current(&entry->references) == 1 &&
                            entry->expires == 0) {
                                unlink_entry(entry);
                        }