]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Print diagnostics on dns_name_issubdomain() failure in fctx_create()
authorOndřej Surý <ondrej@isc.org>
Mon, 24 Aug 2020 08:15:07 +0000 (10:15 +0200)
committerOndřej Surý <ondrej@sury.org>
Wed, 2 Sep 2020 16:29:01 +0000 (18:29 +0200)
Log diagnostic message when dns_name_issubdomain() in the fctx_create()
when the resolver is qname minimizing and forwarding at the same time.

(cherry picked from commit 0a22024c270a38a54f0d51621a046b726df158c0)

lib/dns/resolver.c

index 8a36693a9a4efe6734b4df95648cd57b31678fd7..b37e756c53663d3f802de31c813fa47a7b49aac8 100644 (file)
@@ -5122,7 +5122,14 @@ fctx_create(dns_resolver_t *res, const dns_name_t *name, dns_rdatatype_t type,
 
        log_ns_ttl(fctx, "fctx_create");
 
-       INSIST(dns_name_issubdomain(&fctx->name, &fctx->domain));
+       if (!dns_name_issubdomain(&fctx->name, &fctx->domain)) {
+               dns_name_format(&fctx->domain, buf, sizeof(buf));
+               UNEXPECTED_ERROR(__FILE__, __LINE__,
+                                "'%s' is not subdomain of '%s'", fctx->info,
+                                buf);
+               result = ISC_R_UNEXPECTED;
+               goto cleanup_fcount;
+       }
 
        fctx->qmessage = NULL;
        result = dns_message_create(mctx, DNS_MESSAGE_INTENTRENDER,