diff options
author | antirez <antirez@gmail.com> | 2018-01-18 12:41:05 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2018-01-18 12:41:05 +0100 |
commit | 727dd43614ec45e23e2dedbba08b393323feaa4f (patch) | |
tree | 9145cf53a6c4915c6a59b27ea6ab2bfd090bd8e7 | |
parent | fd8efb7c3615f1a0c78a03388d5b18bc9c4049f8 (diff) | |
download | redis-727dd43614ec45e23e2dedbba08b393323feaa4f.tar.gz |
Fix migrateCommand() access of not initialized byte.
-rw-r--r-- | src/cluster.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cluster.c b/src/cluster.c index 97d311e1b..00fa5d4a2 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -5086,12 +5086,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; |