- Fix that after malloc failure a half-built local_alias does

not crash the server. Thanks to Qifan Zhang, Palo Alto
  Networks, for the report.
This commit is contained in:
W.C.A. Wijngaards
2026-06-16 10:12:19 +02:00
parent 81a19ebeb3
commit 8557788699
3 changed files with 18 additions and 5 deletions
+3
View File
@@ -21,6 +21,9 @@
- Fix that a signed wildcard NSEC, is checked before use,
so it does not allow insecure DS proofs inappropriately.
Thanks to Qifan Zhang, Palo Alto Networks, for the report.
- Fix that after malloc failure a half-built local_alias does
not crash the server. Thanks to Qifan Zhang, Palo Alto
Networks, for the report.
15 June 2026: Wouter
- Fix to add `max-transfer-size` and `max-transfer-time` that
+9 -3
View File
@@ -1569,13 +1569,17 @@ local_data_answer(struct local_zone* z, struct module_env* env,
return 0; /* out of memory */
qinfo->local_alias->rrset = regional_alloc_init(
temp, lr->rrset, sizeof(*lr->rrset));
if(!qinfo->local_alias->rrset)
if(!qinfo->local_alias->rrset) {
qinfo->local_alias = NULL;
return 0; /* out of memory */
}
qinfo->local_alias->rrset->rk.dname = qinfo->qname;
qinfo->local_alias->rrset->rk.dname_len = qinfo->qname_len;
get_cname_target(lr->rrset, &ctarget, &ctargetlen);
if(!ctargetlen)
if(!ctargetlen) {
qinfo->local_alias = NULL;
return 0; /* invalid cname */
}
if(dname_is_wild(ctarget)) {
/* synthesize cname target */
struct packed_rrset_data* d, *lr_d;
@@ -1604,8 +1608,10 @@ local_data_answer(struct local_zone* z, struct module_env* env,
sizeof(struct packed_rrset_data) + sizeof(size_t) +
sizeof(uint8_t*) + sizeof(time_t) + sizeof(uint16_t)
+ newtargetlen);
if(!d)
if(!d) {
qinfo->local_alias = NULL;
return 0; /* out of memory */
}
lr_d = (struct packed_rrset_data*)lr->rrset->entry.data;
qinfo->local_alias->rrset->entry.data = d;
d->ttl = lr_d->rr_ttl[0]; /* RFC6672-like behavior:
+6 -2
View File
@@ -1506,8 +1506,12 @@ struct edns_option* edns_opt_list_find(struct edns_option* list, uint16_t code)
int local_alias_shallow_copy_qname(struct local_rrset* local_alias, uint8_t** qname,
size_t* qname_len)
{
struct ub_packed_rrset_key* rrset = local_alias->rrset;
struct packed_rrset_data* d = rrset->entry.data;
struct ub_packed_rrset_key* rrset;
struct packed_rrset_data* d;
rrset = local_alias->rrset;
if(!rrset) return 0;
d = rrset->entry.data;
if(!d) return 0;
/* Sanity check: our current implementation only supports
* a single CNAME RRset as a local alias. */