aboutsummaryrefslogtreecommitdiff
path: root/external/unbound/services/cache/rrset.c
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2015-04-02 11:16:18 +0200
committerRiccardo Spagni <ric@spagni.net>2015-04-02 11:16:18 +0200
commit1f49833d4fc449d54c95c3235b5c18523e6f8d69 (patch)
treeae027273609339b9b89e3e546552af7a7afb23e7 /external/unbound/services/cache/rrset.c
parentMerge pull request #248 (diff)
downloadmonero-1f49833d4fc449d54c95c3235b5c18523e6f8d69.tar.xz
update unbound from upstream
Diffstat (limited to '')
-rw-r--r--external/unbound/services/cache/rrset.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/external/unbound/services/cache/rrset.c b/external/unbound/services/cache/rrset.c
index 5f52dbce1..2c8552953 100644
--- a/external/unbound/services/cache/rrset.c
+++ b/external/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 */