]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix dns_name_fromwire to honour the active region
authorMark Andrews <marka@isc.org>
Tue, 19 May 2026 01:12:46 +0000 (11:12 +1000)
committerMichał Kępień <michal@isc.org>
Fri, 10 Jul 2026 07:26:46 +0000 (09:26 +0200)
dns_name_fromwire was not honouring the source buffer's active
region when reading names from the wire.  This allowed malformed
records to be accepted when they shouldn't have been.  This has
been corrected.

lib/dns/name.c

index 1bb3f40f6540a70e0beb66be3103a1afba16cbce..e8abbfcd37c52bfea17a26141983e518f2fda0a0 100644 (file)
@@ -1352,7 +1352,7 @@ dns_name_fromwire(dns_name_t *const name, isc_buffer_t *const source,
         * The amount of the source we consumed is set once.
         */
        const uint8_t *const source_buf = isc_buffer_base(source);
-       const uint8_t *const source_max = isc_buffer_used(source);
+       const uint8_t *const source_max = isc_buffer_active(source);
        const uint8_t *const start = isc_buffer_current(source);
        const uint8_t *marker = start;
        const uint8_t *cursor = start;