summaryrefslogtreecommitdiff
path: root/respip/respip.c
diff options
context:
space:
mode:
Diffstat (limited to 'respip/respip.c')
-rw-r--r--respip/respip.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/respip/respip.c b/respip/respip.c
index d61877b556cde..632a9df64756f 100644
--- a/respip/respip.c
+++ b/respip/respip.c
@@ -361,6 +361,7 @@ respip_set_apply_cfg(struct respip_set* set, char* const* tagname, int num_tags,
free(pd);
pd = np;
}
+ addr_tree_init_parents(&set->ip_tree);
return 1;
}
@@ -478,10 +479,16 @@ copy_rrset(const struct ub_packed_rrset_key* key, struct regional* region)
if(!ck->rk.dname)
return NULL;
+ if((unsigned)data->count >= 0xffff00U)
+ return NULL; /* guard against integer overflow in dsize */
dsize = sizeof(struct packed_rrset_data) + data->count *
(sizeof(size_t)+sizeof(uint8_t*)+sizeof(time_t));
- for(i=0; i<data->count; i++)
+ for(i=0; i<data->count; i++) {
+ if((unsigned)dsize >= 0x0fffffffU ||
+ (unsigned)data->rr_len[i] >= 0x0fffffffU)
+ return NULL; /* guard against integer overflow */
dsize += data->rr_len[i];
+ }
d = regional_alloc(region, dsize);
if(!d)
return NULL;
@@ -1181,5 +1188,5 @@ respip_inform_print(struct respip_addr_info* respip_addr, uint8_t* qname,
respip, sizeof(respip));
snprintf(txt, sizeof(txt), "%s/%d inform %s@%u", respip,
respip_addr->net, srcip, port);
- log_nametypeclass(0, txt, qname, qtype, qclass);
+ log_nametypeclass(NO_VERBOSE, txt, qname, qtype, qclass);
}