From bf70d4840cea4ec78579459698ab9b6a7bc76dfb Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 17 Apr 2024 09:40:05 +1000 Subject: [PATCH] dns_qpkey_toname failed to reset name correctly This could lead to a mismatch between name->length and the rest of the name structure. --- lib/dns/qp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/dns/qp.c b/lib/dns/qp.c index dff011ba66..686c3561f5 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 &&