Permalink
Browse files

[issue 620] don't segfault if number of arguments is less than 1

  • Loading branch information...
1 parent a511ce1 commit 2017d8baf757143d5a4ae759380dbd5a12a553f7 @kmerenkov kmerenkov committed with Aug 2, 2011
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/aof.c
View
@@ -327,6 +327,8 @@ int loadAppendOnlyFile(char *filename) {
}
if (buf[0] != '*') goto fmterr;
argc = atoi(buf+1);
+ if (argc < 1) goto fmterr;
+
argv = zmalloc(sizeof(robj*)*argc);
for (j = 0; j < argc; j++) {
if (fgets(buf,sizeof(buf),fp) == NULL) goto readerr;

0 comments on commit 2017d8b

Please sign in to comment.