summaryrefslogtreecommitdiff
path: root/src/redis-cli.c
diff options
context:
space:
mode:
authorSalvatore Sanfilippo <antirez@gmail.com>2019-03-12 17:25:21 +0100
committerGitHub <noreply@github.com>2019-03-12 17:25:21 +0100
commitfba6e26e87da051dfc4aa55272b78861694f6ee2 (patch)
treeacf69e2cd65204ea2470489183f88b2114359774 /src/redis-cli.c
parentb0bc602bb3f38e5b26a912c6395a0fdc3404c909 (diff)
parent0298d3ad1833c0085ebc26baeda58dc3a511de25 (diff)
downloadredis-fba6e26e87da051dfc4aa55272b78861694f6ee2.tar.gz
Merge pull request #5913 from wurongxin1987/unstable
fix a bufferoverflow bug
Diffstat (limited to 'src/redis-cli.c')
-rw-r--r--src/redis-cli.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/redis-cli.c b/src/redis-cli.c
index 5968ee389..5f946b026 100644
--- a/src/redis-cli.c
+++ b/src/redis-cli.c
@@ -2268,7 +2268,7 @@ static clusterManagerNode *clusterManagerNewNode(char *ip, int port) {
static sds clusterManagerGetNodeRDBFilename(clusterManagerNode *node) {
assert(config.cluster_manager_command.backup_dir);
sds filename = sdsnew(config.cluster_manager_command.backup_dir);
- if (filename[sdslen(filename)] - 1 != '/')
+ if (filename[sdslen(filename) - 1] != '/')
filename = sdscat(filename, "/");
filename = sdscatprintf(filename, "redis-node-%s-%d-%s.rdb", node->ip,
node->port, node->name);