mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-02-03 20:29:28 -05:00
size_t no underflow.
git-svn-id: file:///svn/unbound/trunk@681 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
189fafa1da
commit
631ccb58bf
2 changed files with 4 additions and 2 deletions
|
|
@ -10,6 +10,7 @@
|
|||
- dname_pkt_copy checks length of result, to protect result buffers.
|
||||
prints an error, this should not happen. Bad strings should have
|
||||
been rejected earlier in the program.
|
||||
- remove a size_t underflow from msgreply size func.
|
||||
|
||||
15 October 2007: Wouter
|
||||
- nicer warning.
|
||||
|
|
|
|||
|
|
@ -529,8 +529,9 @@ msgreply_sizefunc(void* k, void* d)
|
|||
struct msgreply_entry* q = (struct msgreply_entry*)k;
|
||||
struct reply_info* r = (struct reply_info*)d;
|
||||
size_t s = sizeof(struct msgreply_entry) + sizeof(struct reply_info)
|
||||
+ q->key.qname_len + lock_get_mem(&q->entry.lock);
|
||||
s += (r->rrset_count-1) * sizeof(struct rrset_ref);
|
||||
+ q->key.qname_len + lock_get_mem(&q->entry.lock)
|
||||
- sizeof(struct rrset_ref);
|
||||
s += r->rrset_count * sizeof(struct rrset_ref);
|
||||
s += r->rrset_count * sizeof(struct ub_packed_rrset_key*);
|
||||
return s;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue