mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-08-17 21:25:50 +02:00
- Fix val_find_DS for robustness, to check the result of
packet_rrset_copy_region before using it. Thanks to Xin Wang and Jiajia Liu, Northwestern Polytechnical University, for the report.
This commit is contained in:
@@ -1310,10 +1310,11 @@ val_find_DS(struct module_env* env, uint8_t* nm, size_t nmlen, uint16_t c,
|
||||
/* DS rrset exists. Return it to the validator immediately*/
|
||||
struct ub_packed_rrset_key* copy = packed_rrset_copy_region(
|
||||
rrset, region, *env->now);
|
||||
struct packed_rrset_data* d = copy->entry.data;
|
||||
struct packed_rrset_data* d;
|
||||
lock_rw_unlock(&rrset->entry.lock);
|
||||
if(!copy)
|
||||
return NULL;
|
||||
d = (struct packed_rrset_data*)copy->entry.data;
|
||||
msg = dns_msg_create(nm, nmlen, LDNS_RR_TYPE_DS, c, region, 1);
|
||||
if(!msg)
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user