Skip to content
This repository has been archived by the owner on Jul 11, 2021. It is now read-only.

Commit

Permalink
redis-check-dump: Prevent segfault if can't malloc
Browse files Browse the repository at this point in the history
Found by The Mayhem Team (Alexandre Rebert, Thanassis Avgerinos,
Sang Kil Cha, David Brumley, Manuel Egele) Cylab, Carnegie Mellon
University. See http://bugs.debian.org/716259 for more.

Signed-off-by: Chris Lamb <lamby@debian.org>

Fixes redis#1191
  • Loading branch information
lamby authored and mattsta committed Aug 2, 2014
1 parent 34d0362 commit 5434c99
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/redis-check-dump.c
Expand Up @@ -337,6 +337,7 @@ char* loadStringObject() {
if (len == REDIS_RDB_LENERR) return NULL;

char *buf = malloc(sizeof(char) * (len+1));
if (buf == NULL) return NULL;
buf[len] = '\0';
if (!readBytes(buf, len)) {
free(buf);
Expand Down

0 comments on commit 5434c99

Please sign in to comment.