From: Mark Andrews Date: Wed, 25 Mar 2026 05:13:16 +0000 (+1100) Subject: Allow the dns_rdata_in_apl structure to be walked twice X-Git-Tag: v9.21.21~8^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2fd54f4b2a14ab0a9c9eb18b1ddf913e3b29d12;p=thirdparty%2Fbind9.git Allow the dns_rdata_in_apl structure to be walked twice The offset value should be set prior to calculating the length. --- diff --git a/lib/dns/rdata/in_1/apl_42.c b/lib/dns/rdata/in_1/apl_42.c index ee33fa5c573..ba0d3d041b0 100644 --- a/lib/dns/rdata/in_1/apl_42.c +++ b/lib/dns/rdata/in_1/apl_42.c @@ -331,6 +331,8 @@ dns_rdata_apl_first(dns_rdata_in_apl_t *apl) { return ISC_R_NOMORE; } + apl->offset = 0; + /* * Sanity check data. */ @@ -338,7 +340,6 @@ dns_rdata_apl_first(dns_rdata_in_apl_t *apl) { length = apl->apl[apl->offset + 3] & 0x7f; INSIST(4 + length <= apl->apl_len); - apl->offset = 0; return ISC_R_SUCCESS; }