From: Mark Andrews Date: Tue, 16 Apr 2024 23:40:05 +0000 (+1000) Subject: dns_qpkey_toname failed to reset name correctly X-Git-Tag: v9.19.24~30^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bf70d4840cea4ec78579459698ab9b6a7bc76dfb;p=thirdparty%2Fbind9.git dns_qpkey_toname failed to reset name correctly This could lead to a mismatch between name->length and the rest of the name structure. --- diff --git a/lib/dns/qp.c b/lib/dns/qp.c index dff011ba668..686c3561f5f 100644 --- a/lib/dns/qp.c +++ b/lib/dns/qp.c @@ -259,13 +259,12 @@ dns_qpkey_toname(const dns_qpkey_t key, size_t keylen, dns_name_t *name) { REQUIRE(name->buffer != NULL); REQUIRE(name->offsets != NULL); + dns_name_reset(name); + if (keylen == 0) { - dns_name_reset(name); return; } - isc_buffer_clear(name->buffer); - /* Scan the key looking for label boundaries */ for (offset = 0; offset <= keylen; offset++) { INSIST(key[offset] >= SHIFT_NOBYTE &&