Merge pull request #964 from afcidk/fix-createDoubleObject
Fix potential fault at createDoubleObject
This commit is contained in:
commit
77e4f09ea8
@ -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) {
|
static void *createDoubleObject(const redisReadTask *task, double value, char *str, size_t len) {
|
||||||
redisReply *r, *parent;
|
redisReply *r, *parent;
|
||||||
|
|
||||||
|
if (len == SIZE_MAX) // Prevents hi_malloc(0) if len equals to SIZE_MAX
|
||||||
|
return NULL;
|
||||||
|
|
||||||
r = createReplyObject(REDIS_REPLY_DOUBLE);
|
r = createReplyObject(REDIS_REPLY_DOUBLE);
|
||||||
if (r == NULL)
|
if (r == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user