mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
[issue 620] don't segfault if number of arguments is less than 1
This commit is contained in:
parent
2d7162bb1d
commit
be6f639564
@ -263,6 +263,8 @@ int loadAppendOnlyFile(char *filename) {
|
|||||||
}
|
}
|
||||||
if (buf[0] != '*') goto fmterr;
|
if (buf[0] != '*') goto fmterr;
|
||||||
argc = atoi(buf+1);
|
argc = atoi(buf+1);
|
||||||
|
if (argc < 1) goto fmterr;
|
||||||
|
|
||||||
argv = zmalloc(sizeof(robj*)*argc);
|
argv = zmalloc(sizeof(robj*)*argc);
|
||||||
for (j = 0; j < argc; j++) {
|
for (j = 0; j < argc; j++) {
|
||||||
if (fgets(buf,sizeof(buf),fp) == NULL) goto readerr;
|
if (fgets(buf,sizeof(buf),fp) == NULL) goto readerr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user