summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSalvatore Sanfilippo <antirez@gmail.com>2015-02-25 10:09:40 +0100
committerSalvatore Sanfilippo <antirez@gmail.com>2015-02-25 10:09:40 +0100
commite00cb78f6712ec2f796f430c7de90e1e64c1ec6d (patch)
tree68386ec0d7039bbd55becd9591f094605ab1506e
parent47ab570441f8012fb9aa6a0b38606bc9462e2bd3 (diff)
parent6739ef4447adb17ce2d644b530aea429b8d52445 (diff)
downloadredis-e00cb78f6712ec2f796f430c7de90e1e64c1ec6d.tar.gz
Merge pull request #2054 from mattsta/fix-set-sentinel-quorum
Sentinel: Add initial quorum bounds check
-rw-r--r--src/sentinel.c6
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. */