2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-02 15:45:25 +00:00

rbtdb zone find() function could set foundname incorrectly

when an empty node was found, the result was treated as a partial match,
but foundname could still contain the name of the empty node instead of
its parent.
This commit is contained in:
Evan Hunt
2025-01-08 17:07:08 -08:00
committed by Matthijs Mekking
parent dd1050e938
commit 2025ba8f7a

View File

@@ -1319,11 +1319,19 @@ found:
/* /*
* We have an exact match for the name, but there are no * We have an exact match for the name, but there are no
* active rdatasets in the desired version. That means that * active rdatasets in the desired version. That means that
* this node doesn't exist in the desired version, and that * this node doesn't exist in the desired version.
* we really have a partial match. * If there's a node above this one, reassign the
* foundname to the parent and treat this as a partial
* match.
*/ */
if (!wild) { if (!wild) {
NODE_UNLOCK(lock, &nlocktype); NODE_UNLOCK(lock, &nlocktype);
if (search.chain.level_count > 0) {
dns_dbnode_t *parent =
search.chain.levels
[search.chain.level_count - 1];
dns_rbt_fullnamefromnode(parent, foundname);
}
goto partial_match; goto partial_match;
} }
} }