- Fix for allocation-failure hardening of rrset cache wildcard

storage and canonical NSEC owner replacement. Thanks to Xin
  Wang and Jiajia Liu, Northwestern Polytechnical University,
  for the report.
This commit is contained in:
W.C.A. Wijngaards
2026-05-15 16:00:58 +02:00
parent 8703d9a5be
commit 53c261cb33
3 changed files with 16 additions and 7 deletions
+3 -2
View File
@@ -1322,10 +1322,11 @@ rrset_canonical(struct regional* region, sldns_buffer* buf,
* the non-existence proves. */
if(ntohs(k->rk.type) == LDNS_RR_TYPE_NSEC &&
section == LDNS_SECTION_AUTHORITY && qstate) {
k->rk.dname = regional_alloc_init(qstate->region, can_owner,
uint8_t* new_dname = regional_alloc_init(qstate->region, can_owner,
can_owner_len);
if(!k->rk.dname)
if(!new_dname)
return 0;
k->rk.dname = new_dname;
k->rk.dname_len = can_owner_len;
}