Commit 50cdcab4 authored by Pei-Hsuan Hung's avatar Pei-Hsuan Hung
Browse files

Fix potential fault at createDoubleObject

Resolves #963.

Add additional check to `hi_malloc` for `r->str` when len equals to
SIZE_MAX.
parent c98c6994
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment