From 097d57f56e856920010c164da499b62ad06b9c2a Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 28 Jan 2019 18:15:59 +0100 Subject: [PATCH] ACL: fix crash when checking for subcommands. --- src/acl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/acl.c b/src/acl.c index 9503aec3..132ad79a 100644 --- a/src/acl.c +++ b/src/acl.c @@ -566,8 +566,13 @@ int ACLCheckCommandPerm(client *c) { * command is allowed just with that specific subcommand. */ if (ACLGetUserCommandBit(u,id) == 0) { /* Check if the subcommand matches. */ - if (u->allowed_subcommands == NULL || c->argc < 2) + if (c->argc < 2 || + u->allowed_subcommands == NULL || + u->allowed_subcommands[id] == NULL) + { return ACL_DENIED_CMD; + } + long subid = 0; while (1) { if (u->allowed_subcommands[id][subid] == NULL)