mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-02-03 20:29:28 -05:00
extra sanity check for integer overflow.
git-svn-id: file:///svn/unbound/trunk@3368 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
6c6ef98b38
commit
e9e1b464a6
1 changed files with 1 additions and 0 deletions
|
|
@ -87,6 +87,7 @@ construct_reply_info_base(struct regional* region, uint16_t flags, size_t qd,
|
|||
/* rrset_count-1 because the first ref is part of the struct. */
|
||||
size_t s = sizeof(struct reply_info) - sizeof(struct rrset_ref) +
|
||||
sizeof(struct ub_packed_rrset_key*) * total;
|
||||
if(total >= 0xffffff) return NULL; /* sanity check on numRRS*/
|
||||
if(region)
|
||||
rep = (struct reply_info*)regional_alloc(region, s);
|
||||
else rep = (struct reply_info*)malloc(s +
|
||||
|
|
|
|||
Loading…
Reference in a new issue