Commit c7197ff5 authored by dejun.xdj's avatar dejun.xdj Committed by antirez
Browse files

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.
parent 3f77777f
...@@ -980,7 +980,7 @@ static int cliSendCommand(int argc, char **argv, long repeat) { ...@@ -980,7 +980,7 @@ static int cliSendCommand(int argc, char **argv, long repeat) {
for (j = 0; j < argc; j++) for (j = 0; j < argc; j++)
argvlen[j] = sdslen(argv[j]); argvlen[j] = sdslen(argv[j]);
while(repeat--) { while(repeat-- > 0) {
redisAppendCommandArgv(context,argc,(const char**)argv,argvlen); redisAppendCommandArgv(context,argc,(const char**)argv,argvlen);
while (config.monitor_mode) { while (config.monitor_mode) {
if (cliReadReply(output_raw) != REDIS_OK) exit(1); if (cliReadReply(output_raw) != REDIS_OK) exit(1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment