]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Allow the dns_rdata_in_apl structure to be walked twice
authorMark Andrews <marka@isc.org>
Wed, 25 Mar 2026 05:13:16 +0000 (16:13 +1100)
committerAram Sargsyan <aram@isc.org>
Fri, 27 Mar 2026 12:00:22 +0000 (12:00 +0000)
The offset value should be set prior to calculating the length.

lib/dns/rdata/in_1/apl_42.c

index ee33fa5c5735738742cec875e7408e7aa87b8f80..ba0d3d041b0e627d83de9ef7b9082b01eb1e385f 100644 (file)
@@ -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;
 }