mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 09:00:51 +00:00
Cluster Manager: fixed string parsing issue in clusterManagerGetConfigSignature
This commit is contained in:
parent
2e9859cbfc
commit
d6f0a9ac72
@ -3307,8 +3307,8 @@ static sds clusterManagerGetConfigSignature(clusterManagerNode *node) {
|
|||||||
nodename = token;
|
nodename = token;
|
||||||
tot_size = (p - token);
|
tot_size = (p - token);
|
||||||
name_len = tot_size++; // Make room for ':' in tot_size
|
name_len = tot_size++; // Make room for ':' in tot_size
|
||||||
} else if (i == 8) break;
|
}
|
||||||
i++;
|
if (++i == 8) break;
|
||||||
}
|
}
|
||||||
if (i != 8) continue;
|
if (i != 8) continue;
|
||||||
if (nodename == NULL) continue;
|
if (nodename == NULL) continue;
|
||||||
@ -3347,7 +3347,7 @@ static sds clusterManagerGetConfigSignature(clusterManagerNode *node) {
|
|||||||
char *sp = cfg + name_len;
|
char *sp = cfg + name_len;
|
||||||
*(sp++) = ':';
|
*(sp++) = ':';
|
||||||
for (i = 0; i < c; i++) {
|
for (i = 0; i < c; i++) {
|
||||||
if (i > 0) *(sp++) = '|';
|
if (i > 0) *(sp++) = ',';
|
||||||
int slen = strlen(slots[i]);
|
int slen = strlen(slots[i]);
|
||||||
memcpy(sp, slots[i], slen);
|
memcpy(sp, slots[i], slen);
|
||||||
sp += slen;
|
sp += slen;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user