mirror of
https://github.com/redis/redis.git
synced 2026-05-28 04:02:46 -04:00
Avoid Accessing Arguments Out Of Bounds In handleDebugClusterCommand (#14242)
Noticed we assume there are at least 3 arguments since we access to index 2 in the if and only later check the argc. Moved the argc check to the start of the if so the code will be a bit safer.
This commit is contained in:
parent
c55e33a99f
commit
ff2f0b092c
1 changed files with 3 additions and 3 deletions
|
|
@ -5897,9 +5897,9 @@ int clusterNodeIsMaster(clusterNode *n) {
|
|||
}
|
||||
|
||||
int handleDebugClusterCommand(client *c) {
|
||||
if (strcasecmp(c->argv[1]->ptr, "CLUSTERLINK") ||
|
||||
strcasecmp(c->argv[2]->ptr, "KILL") ||
|
||||
c->argc != 5) {
|
||||
if (c->argc != 5 ||
|
||||
strcasecmp(c->argv[1]->ptr, "CLUSTERLINK") ||
|
||||
strcasecmp(c->argv[2]->ptr, "KILL")) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue