From: Evan Hunt Date: Mon, 1 Apr 2024 20:41:39 +0000 (-0700) Subject: update foundname when detecting a zonecut above qname X-Git-Tag: v9.19.23~7^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea6659a5e982b830350efa75428a90fac94df825;p=thirdparty%2Fbind9.git update foundname when detecting a zonecut above qname an assertion could be triggered in the QPDB cache if a DNAME was found above a queried NS, because the 'foundname' value was not correctly updated to point to the zone cut. the same mistake existed in qpzone and has been fixed there as well. --- diff --git a/lib/dns/qpcache.c b/lib/dns/qpcache.c index 1b5f5ceb7ca..36b55d80a67 100644 --- a/lib/dns/qpcache.c +++ b/lib/dns/qpcache.c @@ -1702,6 +1702,8 @@ find(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version, encloser, (void *)&search DNS__DB_FLARG_PASS); if (zcresult != DNS_R_CONTINUE) { result = DNS_R_PARTIALMATCH; + dns_qpchain_node(&search.chain, i, foundname, + NULL, NULL); search.chain.len = i - 1; node = encloser; break; diff --git a/lib/dns/qpzone.c b/lib/dns/qpzone.c index 6dba83e781e..c78267db897 100644 --- a/lib/dns/qpzone.c +++ b/lib/dns/qpzone.c @@ -3453,6 +3453,8 @@ find(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version, tresult = check_zonecut(n, &search DNS__DB_FLARG_PASS); if (tresult != DNS_R_CONTINUE) { result = tresult; + dns_qpchain_node(&search.chain, i, foundname, NULL, + NULL); search.chain.len = i - 1; node = n; }