]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Check the prunelink member of the correct node
authorMichał Kępień <michal@isc.org>
Sat, 2 Mar 2024 05:36:37 +0000 (06:36 +0100)
committerMichał Kępień <michal@isc.org>
Sat, 2 Mar 2024 05:36:37 +0000 (06:36 +0100)
Commit 4b6fc97af6f936616a12e733b14ffc450af6df87 checks the prunelink
member of the node that was just pruned, not its parent node that was
intended to be examined.  Fix by checking the prunelink member of the
parent node, so that adding the latter to its relevant prunenodes list
twice is properly guarded against.

lib/dns/rbtdb.c

index 38e697769ea4d30c87b462f0ae6839da1e7c1465..2018e69b7e98985eff6c406ea46deaed4dbbbb29 100644 (file)
@@ -2342,7 +2342,7 @@ prune_tree(isc_task_t *task, isc_event_t *event) {
                         * prunenodes list we are currently processing (unless
                         * the parent is already on that list).
                         */
-                       if (!ISC_LINK_LINKED(node, prunelink)) {
+                       if (!ISC_LINK_LINKED(parent, prunelink)) {
                                new_reference(rbtdb, parent,
                                              isc_rwlocktype_write);
                                ISC_LIST_APPEND(rbtdb->prunenodes[locknum],