Jump to right label on AOF parsing error.

Related to #6054.


Former-commit-id: c7159d58f118e840a3b9f72160d1abf3e8a86b3d
This commit is contained in:
antirez 2020-01-13 13:16:13 +01:00 committed by John Sully
parent 0fac746f0e
commit eafcca9f29

View File

@ -815,12 +815,14 @@ int loadAppendOnlyFile(char *filename) {
for (j = 0; j < argc; j++) {
/* Parse the argument len. */
if (fgets(buf,sizeof(buf),fp) == NULL ||
buf[0] != '$')
{
char *readres = fgets(buf,sizeof(buf),fp);
if (readres == NULL || buf[0] != '$') {
fakeClient->argc = j; /* Free up to j-1. */
freeFakeClientArgv(fakeClient);
if (readres == NULL)
goto readerr;
else
goto fmterr;
}
len = strtol(buf+1,NULL,10);