summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2013-07-10 14:44:38 +0200
committerantirez <antirez@gmail.com>2013-07-10 14:44:38 +0200
commit5c5ebb0b9a70d428f982ed7aec5d5a60de605e42 (patch)
tree0ccf96c0305289f98ae5f4c66725ed3e0a745075
parentbd3c897e9fa86ec0e1ddd80986fc704858129897 (diff)
downloadredis-5c5ebb0b9a70d428f982ed7aec5d5a60de605e42.tar.gz
Sentinel: make sure published addr/id buffer is large enough.
With ipv6 support we need more space, so we account for the IP address max size plus what we need for the Run ID, port, flags.
-rw-r--r--src/sentinel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sentinel.c b/src/sentinel.c
index eb729966a..594b7e498 100644
--- a/src/sentinel.c
+++ b/src/sentinel.c
@@ -1839,7 +1839,7 @@ void sentinelPingInstance(sentinelRedisInstance *ri) {
/* PUBLISH hello messages only to masters. */
char ip[REDIS_IP_STR_LEN];
if (anetSockName(ri->cc->c.fd,ip,sizeof(ip),NULL) != -1) {
- char myaddr[128];
+ char myaddr[REDIS_IP_STR_LEN+128];
// FIXME: IPv6 will break this due to nested : characters -geoffgarside
snprintf(myaddr,sizeof(myaddr),"%s:%d:%s:%d",