diff options
author | Salvatore Sanfilippo <antirez@gmail.com> | 2015-02-25 10:09:40 +0100 |
---|---|---|
committer | Salvatore Sanfilippo <antirez@gmail.com> | 2015-02-25 10:09:40 +0100 |
commit | e00cb78f6712ec2f796f430c7de90e1e64c1ec6d (patch) | |
tree | 68386ec0d7039bbd55becd9591f094605ab1506e | |
parent | 47ab570441f8012fb9aa6a0b38606bc9462e2bd3 (diff) | |
parent | 6739ef4447adb17ce2d644b530aea429b8d52445 (diff) | |
download | redis-e00cb78f6712ec2f796f430c7de90e1e64c1ec6d.tar.gz |
Merge pull request #2054 from mattsta/fix-set-sentinel-quorum
Sentinel: Add initial quorum bounds check
-rw-r--r-- | src/sentinel.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sentinel.c b/src/sentinel.c index 7d174ac28..c170818c9 100644 --- a/src/sentinel.c +++ b/src/sentinel.c @@ -2741,6 +2741,12 @@ void sentinelCommand(redisClient *c) { != REDIS_OK) return; if (getLongFromObjectOrReply(c,c->argv[4],&port,"Invalid port") != REDIS_OK) return; + + if (quorum <= 0) { + addReplyError(c, "Quorum must be 1 or greater."); + return; + } + /* Make sure the IP field is actually a valid IP before passing it * to createSentinelRedisInstance(), otherwise we may trigger a * DNS lookup at runtime. */ |