From b4a0e19290043d9b90e67b7c4be06af9cc3f62f2 Mon Sep 17 00:00:00 2001 From: Matthijs Mekking Date: Thu, 1 Jul 2021 14:56:22 +0200 Subject: [PATCH] Fix CID 332468: Memory - illegal accesses (UNINIT) *** CID 332468: Memory - illegal accesses (UNINIT) /lib/dns/zone.c: 6613 in dns_zone_getdnsseckeys() 6607 ISC_LIST_UNLINK(dnskeys, k1, link); 6608 ISC_LIST_APPEND(*keys, k1, link); 6609 } 6610 } 6611 6612 failure: >>> CID 332468: Memory - illegal accesses (UNINIT) >>> Using uninitialized value "keyset.methods" when calling >>> "dns_rdataset_isassociated". 6613 if (dns_rdataset_isassociated(&keyset)) { 6614 dns_rdataset_disassociate(&keyset); 6615 } 6616 if (node != NULL) { 6617 dns_db_detachnode(db, &node); 6618 } Fix by initializing the 'keyset' with 'dns_rdataset_init'. --- lib/dns/zone.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/dns/zone.c b/lib/dns/zone.c index ef52ac18f9..bbd2da00fd 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -6638,6 +6638,8 @@ dns_zone_getdnsseckeys(dns_zone_t *zone, dns_db_t *db, dns_dbversion_t *ver, ISC_LIST_INIT(dnskeys); + dns_rdataset_init(&keyset); + CHECK(dns_db_findnode(db, origin, false, &node)); /* Get keys from private key files. */