mirror of
https://github.com/fluencelabs/redis
synced 2025-03-21 01:50:50 +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)
|
if (getLongLongFromObjectOrReply(c,c->argv[2],&slot,NULL) != REDIS_OK)
|
||||||
return;
|
return;
|
||||||
|
if (slot < 0 || slot >= REDIS_CLUSTER_SLOTS) {
|
||||||
|
addReplyError(c,"Invalid slot");
|
||||||
|
return;
|
||||||
|
}
|
||||||
addReplyLongLong(c,countKeysInSlot(slot));
|
addReplyLongLong(c,countKeysInSlot(slot));
|
||||||
} else if (!strcasecmp(c->argv[1]->ptr,"getkeysinslot") && c->argc == 4) {
|
} else if (!strcasecmp(c->argv[1]->ptr,"getkeysinslot") && c->argc == 4) {
|
||||||
long long maxkeys, slot;
|
long long maxkeys, slot;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user