redis-cli clusterManagerCommandCreate calculate interleaved_len wrong (#8964)

which make interleaved_len bigger and may access array out of range.
This commit is contained in:
Huang Zhw 2021-05-19 19:49:38 +08:00 committed by GitHub
parent 20268d04c0
commit ed2602ab99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -5760,7 +5760,7 @@ assign_replicas:
if (found) slave = found;
else if (firstNodeIdx >= 0) {
slave = interleaved[firstNodeIdx];
interleaved_len -= (interleaved - (interleaved + firstNodeIdx));
interleaved_len -= (firstNodeIdx + 1);
interleaved += (firstNodeIdx + 1);
}
if (slave != NULL) {