From: Mark Andrews Date: Tue, 13 Dec 2022 01:03:49 +0000 (+1100) Subject: Properly initialise local_ndata in isdotlocal in dig X-Git-Tag: v9.19.9~85^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ce163bbc5de7048b338638f89edd4bb261f4c17;p=thirdparty%2Fbind9.git Properly initialise local_ndata in isdotlocal in dig Remove the trailing '\0' so that the length field of the dns_name_t structure is correct. The old data just happens to work with dns_name_issubdomain but would fail with dns_name_equal. --- diff --git a/bin/dig/dig.c b/bin/dig/dig.c index 92ebd06a0bf..50ffdddd8bd 100644 --- a/bin/dig/dig.c +++ b/bin/dig/dig.c @@ -580,7 +580,7 @@ short_answer(dns_message_t *msg, dns_messagetextflag_t flags, isc_buffer_t *buf, static bool isdotlocal(dns_message_t *msg) { isc_result_t result; - static unsigned char local_ndata[] = { "\005local\0" }; + static unsigned char local_ndata[] = { "\005local" }; static unsigned char local_offsets[] = { 0, 6 }; static dns_name_t local = DNS_NAME_INITABSOLUTE(local_ndata, local_offsets);