Fix migrateCommand() access of not initialized byte.

This commit is contained in:
antirez 2018-01-18 12:41:05 +01:00
parent fd8efb7c36
commit 727dd43614

View File

@ -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;