Skip to content

Commit

Permalink
[issue 620] don't segfault if number of arguments is less than 1
Browse files Browse the repository at this point in the history
  • Loading branch information
kmerenkov authored and antirez committed Sep 20, 2011
1 parent a511ce1 commit 2017d8b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/aof.c
Expand Up @@ -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;
Expand Down

0 comments on commit 2017d8b

Please sign in to comment.