提交 be6f6395 编写于 作者: K Konstantin Merenkov

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

上级 2d7162bb
......@@ -263,6 +263,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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册