mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05: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;
|
||||
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. */
|
||||
|
Loading…
Reference in New Issue
Block a user