Check if the repeat value is positive in while loop of cliSendCommand().

In case that the incoming repeat parameter is negative and causes a
deadless loop.
This commit is contained in:
dejun.xdj 2018-05-21 12:06:48 +08:00 committed by antirez
parent 3f77777ffd
commit c7197ff50f

View File

@ -980,7 +980,7 @@ static int cliSendCommand(int argc, char **argv, long repeat) {
for (j = 0; j < argc; j++)
argvlen[j] = sdslen(argv[j]);
while(repeat--) {
while(repeat-- > 0) {
redisAppendCommandArgv(context,argc,(const char**)argv,argvlen);
while (config.monitor_mode) {
if (cliReadReply(output_raw) != REDIS_OK) exit(1);