From 6739ef4447adb17ce2d644b530aea429b8d52445 Mon Sep 17 00:00:00 2001 From: Matt Stancliff Date: Fri, 10 Oct 2014 10:35:34 -0400 Subject: Sentinel: Add initial quorum bounds check Fixes #2054 --- src/sentinel.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/sentinel.c b/src/sentinel.c index 8e78a2263..6d7096b6c 100644 --- a/src/sentinel.c +++ b/src/sentinel.c @@ -2736,6 +2736,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. */ -- cgit v1.2.1