mirror of
https://github.com/fluencelabs/redis
synced 2025-03-20 09:30:55 +00:00
Cluster: validate slot number in CLUSTER COUNTKEYSINSLOT.
This commit is contained in:
parent
996a643752
commit
544bbe5387
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user