From ea6659a5e982b830350efa75428a90fac94df825 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Mon, 1 Apr 2024 13:41:39 -0700 Subject: [PATCH] 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. --- lib/dns/qpcache.c | 2 ++ lib/dns/qpzone.c | 2 ++ 2 files changed, 4 insertions(+) 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; } -- 2.47.3