summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2019-02-08 12:38:41 +0100
committerantirez <antirez@gmail.com>2019-02-08 12:38:41 +0100
commitd453936b52ced6e0fbf74a59c1df4147a9870d37 (patch)
tree74db2ecbe90f967a63080654fd9721dd045d845d
parentd4890c20c10d91e990b8af044a233d3e1da7bda0 (diff)
downloadredis-d453936b52ced6e0fbf74a59c1df4147a9870d37.tar.gz
ACL: add arity check in ACL command where missing.
-rw-r--r--src/acl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/acl.c b/src/acl.c
index 159a3507a..2e2bd24a5 100644
--- a/src/acl.c
+++ b/src/acl.c
@@ -1403,13 +1403,13 @@ void aclCommand(client *c) {
}
}
raxStop(&ri);
- } else if (!strcasecmp(sub,"whoami")) {
+ } else if (!strcasecmp(sub,"whoami") && c->argc == 2) {
if (c->user != NULL) {
addReplyBulkCBuffer(c,c->user->name,sdslen(c->user->name));
} else {
addReplyNull(c);
}
- } else if (!strcasecmp(sub,"load")) {
+ } else if (!strcasecmp(sub,"load") && c->argc == 2) {
if (server.acl_filename[0] == '\0') {
addReplyError(c,"This Redis instance is not configured to use an ACL file. You may want to specify users via the ACL SETUSER command and then issue a CONFIG REWRITE (assuming you have a Redis configuration file set) in order to store users in the Redis configuration.");
return;