+3996. [bug] Address use after free on out of memory error in
+ keyring_add. [RT #37639]
+
3995. [bug] receive_secure_serial holds the zone lock for too
long. [RT #37626]
}
result = dns_rbt_addname(ring->keys, name, tkey);
- if (tkey->generated) {
+ if (result == ISC_R_SUCCESS && tkey->generated) {
/*
* Add the new key to the LRU list and remove the least
* recently used key if there are too many keys on the list.
*/
- ISC_LIST_INITANDAPPEND(ring->lru, tkey, link);
+ ISC_LIST_APPEND(ring->lru, tkey, link);
if (ring->generated++ > ring->maxgenerated)
remove_fromring(ISC_LIST_HEAD(ring->lru));
}
tkey->expire = expire;
tkey->mctx = NULL;
isc_mem_attach(mctx, &tkey->mctx);
+ ISC_LINK_INIT(tkey, link);
tkey->magic = TSIG_MAGIC;