mirror of
https://github.com/fluencelabs/redis
synced 2025-03-30 22:31:03 +00:00
bad data on RESTORE can no longer crash the server but create a memory leak with some input string
This commit is contained in:
parent
f304f22b22
commit
f797c7dc17
@ -1140,8 +1140,10 @@ void restoreCommand(redisClient *c) {
|
|||||||
|
|
||||||
/* Finally create the object from the serialized dump and
|
/* Finally create the object from the serialized dump and
|
||||||
* store it at the specified key. */
|
* store it at the specified key. */
|
||||||
o = rdbLoadObject(data[0],fp);
|
if ((data[0] > 4 && data[0] < 9) ||
|
||||||
if (o == NULL) {
|
data[0] > 11 ||
|
||||||
|
(o = rdbLoadObject(data[0],fp)) == NULL)
|
||||||
|
{
|
||||||
addReplyError(c,"Bad data format.");
|
addReplyError(c,"Bad data format.");
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user