From 0b59306166a819e2eba6dbf2c79105b232cbfd8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Sat, 2 Mar 2024 06:36:37 +0100 Subject: [PATCH] Check the prunelink member of the correct node Commit 37101c7c8abbacaf07c30d5094bc6880cf4f7ca0 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. (cherry picked from commit 7d9be24bb1e021560d58949d933274df53a2d69f) --- lib/dns/rbtdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index bb154824ab..bbeb742d51 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -2318,7 +2318,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],