Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
175515c9
Commit
175515c9
authored
Nov 02, 2018
by
artix
Committed by
antirez
Nov 07, 2018
Browse files
Cluster Manager: fixed string parsing issue in clusterManagerGetConfigSignature
parent
3997dd6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-cli.c
View file @
175515c9
...
@@ -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
++
;
i
f (++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;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment