Commit d6f0a9ac authored by artix's avatar artix
Browse files

Cluster Manager: fixed string parsing issue in clusterManagerGetConfigSignature

parent 2e9859cb
...@@ -3307,8 +3307,8 @@ static sds clusterManagerGetConfigSignature(clusterManagerNode *node) { ...@@ -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) { ...@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment