mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-21 07:10:43 -05:00
Check before storing value.
git-svn-id: file:///svn/unbound/trunk@3373 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
6feb8fb6a5
commit
383e32f02f
1 changed files with 3 additions and 3 deletions
|
|
@ -652,13 +652,13 @@ load_msg(SSL* ssl, sldns_buffer* buf, struct worker* worker)
|
||||||
rep.ttl = (time_t)ttl;
|
rep.ttl = (time_t)ttl;
|
||||||
rep.prefetch_ttl = PREFETCH_TTL_CALC(rep.ttl);
|
rep.prefetch_ttl = PREFETCH_TTL_CALC(rep.ttl);
|
||||||
rep.security = (enum sec_status)security;
|
rep.security = (enum sec_status)security;
|
||||||
rep.an_numrrsets = (size_t)an;
|
|
||||||
rep.ns_numrrsets = (size_t)ns;
|
|
||||||
rep.ar_numrrsets = (size_t)ar;
|
|
||||||
if(an > RR_COUNT_MAX || ns > RR_COUNT_MAX || ar > RR_COUNT_MAX) {
|
if(an > RR_COUNT_MAX || ns > RR_COUNT_MAX || ar > RR_COUNT_MAX) {
|
||||||
log_warn("error too many rrsets");
|
log_warn("error too many rrsets");
|
||||||
return 0; /* protect against integer overflow in alloc */
|
return 0; /* protect against integer overflow in alloc */
|
||||||
}
|
}
|
||||||
|
rep.an_numrrsets = (size_t)an;
|
||||||
|
rep.ns_numrrsets = (size_t)ns;
|
||||||
|
rep.ar_numrrsets = (size_t)ar;
|
||||||
rep.rrset_count = (size_t)an+(size_t)ns+(size_t)ar;
|
rep.rrset_count = (size_t)an+(size_t)ns+(size_t)ar;
|
||||||
rep.rrsets = (struct ub_packed_rrset_key**)regional_alloc_zero(
|
rep.rrsets = (struct ub_packed_rrset_key**)regional_alloc_zero(
|
||||||
region, sizeof(struct ub_packed_rrset_key*)*rep.rrset_count);
|
region, sizeof(struct ub_packed_rrset_key*)*rep.rrset_count);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue