]> 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 19:48:20 +0000 (19:48 +0000)
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.

lib/dns/sdlz.c

index 5476ef391f05fc8ec00da7a0ce91e7794b278670..5eea5cb6b96f1077a8e7dc502b6992355cfa98b0 100644 (file)
@@ -1852,7 +1852,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;
@@ -1864,6 +1863,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;
        }