]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Do not convert ISC_R_NOSPACE to DNS_R_SERVFAIL too early
authorMark Andrews <marka@isc.org>
Wed, 24 Nov 2021 00:03:19 +0000 (11:03 +1100)
committerMark Andrews <marka@isc.org>
Thu, 25 Nov 2021 20:44:37 +0000 (07:44 +1100)
The parsing loop needs to process ISC_R_NOSPACE to properly
size the buffer.  If result is still ISC_R_NOSPACE at the end
of the parsing loop set result to DNS_R_SERVFAIL.

(cherry picked from commit 08f1cba096243cd14041731b7ea1ad45e54e87b0)

lib/dns/sdlz.c

index c8a615a0f3d6020e99607dd23c2af0f7fdc85ca0..0b46fb9efdfac0c22455a14e7901749619f2e492 100644 (file)
@@ -1875,7 +1875,6 @@ dns_sdlz_putrr(dns_sdlzlookup_t *lookup, const char *type, dns_ttl_t ttl,
                                            mctx, rdatabuf, &lookup->callbacks);
                if (result != ISC_R_SUCCESS) {
                        isc_buffer_free(&rdatabuf);
-                       result = DNS_R_SERVFAIL;
                }
                if (size >= 65535) {
                        break;
@@ -1887,6 +1886,7 @@ dns_sdlz_putrr(dns_sdlzlookup_t *lookup, const char *type, dns_ttl_t ttl,
        } while (result == ISC_R_NOSPACE);
 
        if (result != ISC_R_SUCCESS) {
+               result = DNS_R_SERVFAIL;
                goto failure;
        }