Commit e00cb78f authored by Salvatore Sanfilippo's avatar Salvatore Sanfilippo
Browse files

Merge pull request #2054 from mattsta/fix-set-sentinel-quorum

Sentinel: Add initial quorum bounds check
parents 47ab5704 6739ef44
...@@ -2741,6 +2741,12 @@ void sentinelCommand(redisClient *c) { ...@@ -2741,6 +2741,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