mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
zero length bulk data reading fixed in loadAppendOnlyFile()
This commit is contained in:
parent
85a831729f
commit
0f151ef1a0
2
redis.c
2
redis.c
@ -5740,7 +5740,7 @@ int loadAppendOnlyFile(char *filename) {
|
|||||||
if (buf[0] != '$') goto fmterr;
|
if (buf[0] != '$') goto fmterr;
|
||||||
len = strtol(buf+1,NULL,10);
|
len = strtol(buf+1,NULL,10);
|
||||||
argsds = sdsnewlen(NULL,len);
|
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);
|
argv[j] = createObject(REDIS_STRING,argsds);
|
||||||
if (fread(buf,2,1,fp) == 0) goto fmterr; /* discard CRLF */
|
if (fread(buf,2,1,fp) == 0) goto fmterr; /* discard CRLF */
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user