summaryrefslogtreecommitdiff
path: root/hiredis.c
diff options
context:
space:
mode:
authormichael-grunder <michael.grunder@gmail.com>2021-10-07 14:47:11 -0700
committerMichael Grunder <michael.grunder@gmail.com>2021-10-10 11:13:23 -0700
commite489846b7226958718ae91fa0c4999b420c706e2 (patch)
tree1df0ad3283eb91e06b84ca6546f33856f01ce031 /hiredis.c
parent51c740824be0a604d931bdc6738a74f1ee0abb36 (diff)
Minor refactor of CVE-2021-32765 fix.
Since `hi_calloc` always passes through one of our wrapper functions, we can perform this overflow in the wrapper, and get protection everywhere. Previous commit: 76a7b10005c70babee357a7d0f2becf28ec7ed1e Related vuln ID: CVE-2021-32765 [Full Details](https://github.com/redis/hiredis/security/advisories/GHSA-hfm9-39pp-55p2)
Diffstat (limited to 'hiredis.c')
-rw-r--r--hiredis.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/hiredis.c b/hiredis.c
index 15de4ad..7e7af82 100644
--- a/hiredis.c
+++ b/hiredis.c
@@ -178,7 +178,6 @@ static void *createArrayObject(const redisReadTask *task, size_t elements) {
return NULL;
if (elements > 0) {
- if (SIZE_MAX / sizeof(redisReply*) < elements) return NULL; /* Don't overflow */
r->element = hi_calloc(elements,sizeof(redisReply*));
if (r->element == NULL) {
freeReplyObject(r);