From dea77b5ca275cc6773cb9ca0c864005022c70810 Mon Sep 17 00:00:00 2001 From: Leonardo Date: Fri, 27 Sep 2019 00:06:26 -0300 Subject: [PATCH] A minor fix to intervalheap.h --- src/ext/intervalheap.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ext/intervalheap.h b/src/ext/intervalheap.h index 74fbbb6..a1181a3 100644 --- a/src/ext/intervalheap.h +++ b/src/ext/intervalheap.h @@ -171,6 +171,9 @@ static const char *cmc_string_fmt_intervalheap = "%s at %p { buffer:%p, capacity \ SNAME *PFX##_new(size_t capacity, int (*compare)(V, V)) \ { \ + if (capacity == 0 || capacity == UINT64_MAX) \ + return NULL; \ + \ SNAME *_heap_ = malloc(sizeof(SNAME)); \ \ if (!_heap_) \