]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
fix a message parsing regression
authorEvan Hunt <each@isc.org>
Tue, 16 Jan 2024 23:58:53 +0000 (15:58 -0800)
committerMichał Kępień <michal@isc.org>
Wed, 31 Jan 2024 14:52:46 +0000 (15:52 +0100)
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.

lib/dns/message.c

index 8280aa287fa3e6c242f0b721ebf4f7b6b2963d51..b0d5f16da7abaa0d3020f532c64e1613a251a65c 100644 (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);
        }