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

Sentinel: Add initial quorum bounds check
This commit is contained in:
Salvatore Sanfilippo 2015-02-25 10:09:40 +01:00
commit e00cb78f67

View File

@ -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. */