Commit 95b988b6 authored by dejun.xdj's avatar dejun.xdj
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 cc7ffdfd
......@@ -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);
......
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