diff options
author | Matt Stancliff <matt@genges.com> | 2014-10-10 10:35:34 -0400 |
---|---|---|
committer | Matt Stancliff <matt@genges.com> | 2014-11-20 16:30:17 -0500 |
commit | 6739ef4447adb17ce2d644b530aea429b8d52445 (patch) | |
tree | 1565319bf1d6d55a07c77d75d7260e688eea3347 /src/sentinel.c | |
parent | 0ed2c601185eb04b3b791b218e2a48c5f0609493 (diff) | |
download | redis-6739ef4447adb17ce2d644b530aea429b8d52445.tar.gz |
Sentinel: Add initial quorum bounds check
Fixes #2054
Diffstat (limited to 'src/sentinel.c')
-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 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. */ |