mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
Merge pull request #2054 from mattsta/fix-set-sentinel-quorum
Sentinel: Add initial quorum bounds check
This commit is contained in:
commit
e00cb78f67
@ -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. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user