fix a message parsing regression

the fix for CVE-2023-4408 introduced a regression in the message
parser, which could cause a crash if duplicate rdatasets were found
in the question section. this commit ensures that rdatasets are
correctly disassociated and freed when this occurs.
This commit is contained in:
Evan Hunt 2024-01-16 15:58:53 -08:00 committed by Michał Kępień
parent aca85323d6
commit 4c19d35614
No known key found for this signature in database

View file

@ -1130,6 +1130,9 @@ getquestions(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t dctx,
cleanup:
if (rdataset != NULL) {
if (dns_rdataset_isassociated(rdataset)) {
dns_rdataset_disassociate(rdataset);
}
dns_message_puttemprdataset(msg, &rdataset);
}