Allow the dns_rdata_in_apl structure to be walked twice

The offset value should be set prior to calculating the length.
This commit is contained in:
Mark Andrews 2026-03-25 16:13:16 +11:00 committed by Aram Sargsyan
parent e435b0b7fb
commit f2fd54f4b2

View 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;
}