Commit 6739ef44 authored by Matt Stancliff's avatar Matt Stancliff
Browse files

Sentinel: Add initial quorum bounds check

Fixes #2054
parent 0ed2c601
...@@ -2736,6 +2736,12 @@ void sentinelCommand(redisClient *c) { ...@@ -2736,6 +2736,12 @@ void sentinelCommand(redisClient *c) {
!= REDIS_OK) return; != REDIS_OK) return;
if (getLongFromObjectOrReply(c,c->argv[4],&port,"Invalid port") if (getLongFromObjectOrReply(c,c->argv[4],&port,"Invalid port")
!= REDIS_OK) return; != 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 /* Make sure the IP field is actually a valid IP before passing it
* to createSentinelRedisInstance(), otherwise we may trigger a * to createSentinelRedisInstance(), otherwise we may trigger a
* DNS lookup at runtime. */ * DNS lookup at runtime. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment