Skip to content
This repository
Browse code

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

  • Loading branch information...
commit 2017d8baf757143d5a4ae759380dbd5a12a553f7 1 parent a511ce1
Konstantin Merenkov kmerenkov authored committed

Showing 1 changed file with 2 additions and 0 deletions. Show diff stats Hide diff stats

  1. +2 0  src/aof.c
2  src/aof.c
@@ -327,6 +327,8 @@ int loadAppendOnlyFile(char *filename) {
327 327 }
328 328 if (buf[0] != '*') goto fmterr;
329 329 argc = atoi(buf+1);
  330 + if (argc < 1) goto fmterr;
  331 +
330 332 argv = zmalloc(sizeof(robj*)*argc);
331 333 for (j = 0; j < argc; j++) {
332 334 if (fgets(buf,sizeof(buf),fp) == NULL) goto readerr;

0 comments on commit 2017d8b

Please sign in to comment.
Something went wrong with that request. Please try again.