bind9/lib/dns/rdata
Ondřej Surý 815587fbe6 Consume the preference before reading the locator in NID/L64/L32 tostruct
tostruct_nid() and tostruct_l64() read the 16-bit preference with the
non-consuming uint16_fromregion() and then memmove()'d the whole
remaining region -- still ten octets, still anchored at the preference
-- into the eight-octet nid[]/l64[] arrays. That folded the preference
into the first two locator octets and stored two octets past the end of
the array. tostruct_l32() shares the root cause: it read the 32-bit
locator from the same unconsumed offset, so the value was built from the
preference plus the first two locator octets.

Consume the two preference octets first, matching the sibling
tostruct_lp(), and assert the expected framing on the fixed-size types.

(cherry picked from commit 5aa279bbea)
2026-07-02 10:55:30 +00:00
..
any_255 Use DNS_RDATACOMMON_INIT to hide branch differences 2025-08-15 06:22:47 +10:00
ch_3 Use DNS_RDATACOMMON_INIT to hide branch differences 2025-08-15 06:22:47 +10:00
generic Consume the preference before reading the locator in NID/L64/L32 tostruct 2026-07-02 10:55:30 +00:00
hs_4 Use DNS_RDATACOMMON_INIT to hide branch differences 2025-08-15 06:22:47 +10:00
in_1 Fix spelling typos in comments and code 2026-06-01 15:04:31 +00:00
rdatastructpre.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
rdatastructsuf.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00