summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hiredis.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hiredis.c b/hiredis.c
index 7e7af82..ba77a77 100644
--- a/hiredis.c
+++ b/hiredis.c
@@ -221,6 +221,9 @@ static void *createIntegerObject(const redisReadTask *task, long long value) {
static void *createDoubleObject(const redisReadTask *task, double value, char *str, size_t len) {
redisReply *r, *parent;
+ if (len == SIZE_MAX) // Prevents hi_malloc(0) if len equals to SIZE_MAX
+ return NULL;
+
r = createReplyObject(REDIS_REPLY_DOUBLE);
if (r == NULL)
return NULL;