]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
update foundname when detecting a zonecut above qname
authorEvan Hunt <each@isc.org>
Mon, 1 Apr 2024 20:41:39 +0000 (13:41 -0700)
committerOndřej Surý <ondrej@isc.org>
Tue, 2 Apr 2024 08:00:03 +0000 (10:00 +0200)
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
lib/dns/qpzone.c

index 1b5f5ceb7caaa5e7009d91d4a1662e9d6cd22c74..36b55d80a677988d2875e6694b89a17c63c4d590 100644 (file)
@@ -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;
index 6dba83e781e744b9ef4ba56c1197b259b96e0836..c78267db897f07000810e196c8e643b621dcb569 100644 (file)
@@ -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;
                }