summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Lamb <lamby@debian.org>2013-07-11 12:45:15 +0100
committerantirez <antirez@gmail.com>2014-08-08 14:10:34 +0200
commitaf62d9a687c7f61178c1fd8a4c7c9f1cc3d5083f (patch)
tree541a3ca79ea80a120f2bd4e1c9a353794ba9750c /src
parent354119e4c50fbb3074f2d085300a1b399d4d89af (diff)
downloadredis-af62d9a687c7f61178c1fd8a4c7c9f1cc3d5083f.tar.gz
redis-check-dump: Prevent segfault if can't malloc
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 #1191
Diffstat (limited to 'src')
-rw-r--r--src/redis-check-dump.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/redis-check-dump.c b/src/redis-check-dump.c
index 854e43253..c8b0f6962 100644
--- a/src/redis-check-dump.c
+++ b/src/redis-check-dump.c
@@ -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);