diff --git a/src/cluster.c b/src/cluster.c index b57dd48c..783c658d 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -1140,8 +1140,10 @@ void restoreCommand(redisClient *c) { /* Finally create the object from the serialized dump and * store it at the specified key. */ - o = rdbLoadObject(data[0],fp); - if (o == NULL) { + if ((data[0] > 4 && data[0] < 9) || + data[0] > 11 || + (o = rdbLoadObject(data[0],fp)) == NULL) + { addReplyError(c,"Bad data format."); fclose(fp); return;