zero length bulk data reading fixed in loadAppendOnlyFile()

This commit is contained in:
antirez 2009-11-26 19:18:52 +01:00
parent 85a831729f
commit 0f151ef1a0

View File

@ -5740,7 +5740,7 @@ int loadAppendOnlyFile(char *filename) {
if (buf[0] != '$') goto fmterr;
len = strtol(buf+1,NULL,10);
argsds = sdsnewlen(NULL,len);
if (fread(argsds,len,1,fp) == 0) goto fmterr;
if (len && fread(argsds,len,1,fp) == 0) goto fmterr;
argv[j] = createObject(REDIS_STRING,argsds);
if (fread(buf,2,1,fp) == 0) goto fmterr; /* discard CRLF */
}