From eb840f9bc5e44d56a6a0c525955aef37276cfabd Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 25 Jan 2019 13:07:20 +0100 Subject: [PATCH] ACL: fix command ID assignment off by one error. --- src/acl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/acl.c b/src/acl.c index a011aa9a..586432c6 100644 --- a/src/acl.c +++ b/src/acl.c @@ -511,6 +511,7 @@ unsigned long ACLGetCommandID(const char *cmdname) { raxInsert(map,(unsigned char*)lowername,strlen(lowername), (void*)nextid,NULL); sdsfree(lowername); + unsigned long thisid = nextid; nextid++; /* We never assign the last bit in the user commands bitmap structure, @@ -522,7 +523,7 @@ unsigned long ACLGetCommandID(const char *cmdname) { * default (loaded via modules). This is useful when rewriting the ACLs * with ACL SAVE. */ if (nextid == USER_COMMAND_BITS_COUNT-1) nextid++; - return nextid; + return thisid; } /* Return an username by its name, or NULL if the user does not exist. */