summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2018-01-18 12:41:05 +0100
committerantirez <antirez@gmail.com>2018-01-18 12:41:23 +0100
commit4acd6973bf0b85c80b85f43e94884f4e6d360ab7 (patch)
tree953a514ab723a883e282bd520293d51f97276cba /src
parent548e4fe088e003b334b0914fa7621606b821df79 (diff)
downloadredis-4acd6973bf0b85c80b85f43e94884f4e6d360ab7.tar.gz
Fix migrateCommand() access of not initialized byte.
Diffstat (limited to 'src')
-rw-r--r--src/cluster.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cluster.c b/src/cluster.c
index 084d7b02f..f325c257c 100644
--- a/src/cluster.c
+++ b/src/cluster.c
@@ -5057,12 +5057,15 @@ try_again:
socket_error = 1;
break;
}
- if (buf0[0] == '-' || (select && buf1[0] == '-') || buf2[0] == '-') {
+ if ((password && buf0[0] == '-') ||
+ (select && buf1[0] == '-') ||
+ buf2[0] == '-')
+ {
/* On error assume that last_dbid is no longer valid. */
if (!error_from_target) {
cs->last_dbid = -1;
char *errbuf;
- if (buf0[0] == '-') errbuf = buf0;
+ if (password && buf0[0] == '-') errbuf = buf0;
else if (select && buf1[0] == '-') errbuf = buf1;
else errbuf = buf2;