diff options
author | dejun.xdj <dejun.xdj@alibaba-inc.com> | 2018-05-21 12:06:48 +0800 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2018-05-29 12:46:27 +0200 |
commit | c7197ff50f09d9e27d65f06964a17767f1ec3afc (patch) | |
tree | e2d5f967541bfe5eac378af54c34ed6e5bf73a17 | |
parent | 3f77777ffd98f4d5686c8ed5ae883b1834021c77 (diff) | |
download | redis-c7197ff50f09d9e27d65f06964a17767f1ec3afc.tar.gz |
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.
-rw-r--r-- | src/redis-cli.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/redis-cli.c b/src/redis-cli.c index 6ae25e8ba..f10382ed9 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -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); |