mirror of https://github.com/redis/redis.git
Avoid Accessing Arguments Out Of Bounds In handleDebugClusterCommand (#14242)
CI / test-ubuntu-latest (push) Has been cancelled
Details
CI / test-sanitizer-address (push) Has been cancelled
Details
CI / build-debian-old (push) Has been cancelled
Details
CI / build-macos-latest (push) Has been cancelled
Details
CI / build-32bit (push) Has been cancelled
Details
CI / build-libc-malloc (push) Has been cancelled
Details
CI / build-centos-jemalloc (push) Has been cancelled
Details
CI / build-old-chain-jemalloc (push) Has been cancelled
Details
Codecov / code-coverage (push) Has been cancelled
Details
External Server Tests / test-external-standalone (push) Has been cancelled
Details
External Server Tests / test-external-cluster (push) Has been cancelled
Details
External Server Tests / test-external-nodebug (push) Has been cancelled
Details
Spellcheck / Spellcheck (push) Has been cancelled
Details
CI / test-ubuntu-latest (push) Has been cancelled
Details
CI / test-sanitizer-address (push) Has been cancelled
Details
CI / build-debian-old (push) Has been cancelled
Details
CI / build-macos-latest (push) Has been cancelled
Details
CI / build-32bit (push) Has been cancelled
Details
CI / build-libc-malloc (push) Has been cancelled
Details
CI / build-centos-jemalloc (push) Has been cancelled
Details
CI / build-old-chain-jemalloc (push) Has been cancelled
Details
Codecov / code-coverage (push) Has been cancelled
Details
External Server Tests / test-external-standalone (push) Has been cancelled
Details
External Server Tests / test-external-cluster (push) Has been cancelled
Details
External Server Tests / test-external-nodebug (push) Has been cancelled
Details
Spellcheck / Spellcheck (push) Has been cancelled
Details
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
|
@ -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 New Issue