diff options
author | Michael Grunder <michael.grunder@gmail.com> | 2022-08-29 12:24:57 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-29 12:24:57 -0700 |
commit | 77e4f09ea8e01a500586c6b2aa37a76c98e172f0 (patch) | |
tree | 9e1c3e57795ab2e62c54c9f8d2a25132bd3d661b | |
parent | 9219f7e7c3e7fa4085658888398e42d6da70584c (diff) | |
parent | 50cdcab49d539e4703018185992abf3214088e85 (diff) | |
download | hiredict-77e4f09ea8e01a500586c6b2aa37a76c98e172f0.tar.xz |
Merge pull request #964 from afcidk/fix-createDoubleObject
Fix potential fault at createDoubleObject
-rw-r--r-- | hiredis.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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; |