summaryrefslogtreecommitdiffstats
path: root/contrib/unbound/services/cache/rrset.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2015-12-04 13:26:12 +0000
committerdes <des@FreeBSD.org>2015-12-04 13:26:12 +0000
commit72c7e45913048bf7a7a9f4f898363ea802ba3ab7 (patch)
tree658b312c2da2a4079aee851908bd5b4bd805ab2b /contrib/unbound/services/cache/rrset.c
parentfc230dcf447eb45f054aa940c35313f825b926df (diff)
downloadFreeBSD-src-72c7e45913048bf7a7a9f4f898363ea802ba3ab7.zip
FreeBSD-src-72c7e45913048bf7a7a9f4f898363ea802ba3ab7.tar.gz
MFH (r287917, r287918, r289063): upgrade to latest Unbound
MFH (r283301, r289592, r291582): rc script improvements MFH (r287880): respect manually configured forwarders when using DHCP MFH (r289321): deconfuse man page PR: 184047 203580 204931
Diffstat (limited to 'contrib/unbound/services/cache/rrset.c')
-rw-r--r--contrib/unbound/services/cache/rrset.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/contrib/unbound/services/cache/rrset.c b/contrib/unbound/services/cache/rrset.c
index 5f52dbc..2c85529 100644
--- a/contrib/unbound/services/cache/rrset.c
+++ b/contrib/unbound/services/cache/rrset.c
@@ -40,7 +40,7 @@
*/
#include "config.h"
#include "services/cache/rrset.h"
-#include "ldns/rrdef.h"
+#include "sldns/rrdef.h"
#include "util/storage/slabhash.h"
#include "util/config_file.h"
#include "util/data/packed_rrset.h"
@@ -304,10 +304,11 @@ rrset_array_unlock_touch(struct rrset_cache* r, struct regional* scratch,
{
hashvalue_t* h;
size_t i;
- if(!(h = (hashvalue_t*)regional_alloc(scratch,
- sizeof(hashvalue_t)*count)))
+ if(count > RR_COUNT_MAX || !(h = (hashvalue_t*)regional_alloc(scratch,
+ sizeof(hashvalue_t)*count))) {
log_warn("rrset LRU: memory allocation failed");
- else /* store hash values */
+ h = NULL;
+ } else /* store hash values */
for(i=0; i<count; i++)
h[i] = ref[i].key->entry.hash;
/* unlock */
OpenPOWER on IntegriCloud