Merge pull request #964 from afcidk/fix-createDoubleObject

Fix potential fault at createDoubleObject
master
Michael Grunder 2022-08-29 12:24:57 -07:00 committed by GitHub
commit 77e4f09ea8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -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;