Cluster: validate slot number in CLUSTER COUNTKEYSINSLOT.

This commit is contained in:
antirez 2013-02-25 12:40:32 +01:00
parent 996a643752
commit 544bbe5387

View File

@ -1645,6 +1645,10 @@ void clusterCommand(redisClient *c) {
if (getLongLongFromObjectOrReply(c,c->argv[2],&slot,NULL) != REDIS_OK)
return;
if (slot < 0 || slot >= REDIS_CLUSTER_SLOTS) {
addReplyError(c,"Invalid slot");
return;
}
addReplyLongLong(c,countKeysInSlot(slot));
} else if (!strcasecmp(c->argv[1]->ptr,"getkeysinslot") && c->argc == 4) {
long long maxkeys, slot;