summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-12-15 10:18:22 +0100
committerantirez <antirez@gmail.com>2014-12-15 10:18:29 +0100
commit2c6dc9f15ff7e84fa924f73f3a7b3b81f4b17aca (patch)
treebb96f7a5509608ece287b71411ba96ea224fbd19
parent722faed62a481044f7e3602f7d053d5117e0f110 (diff)
downloadredis-2c6dc9f15ff7e84fa924f73f3a7b3b81f4b17aca.tar.gz
Make sure buffer is enough in clusterSendPing().
-rw-r--r--src/cluster.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cluster.c b/src/cluster.c
index 80ac66e41..15483ff8e 100644
--- a/src/cluster.c
+++ b/src/cluster.c
@@ -2071,7 +2071,7 @@ void clusterBuildMessageHdr(clusterMsg *hdr, int type) {
/* Send a PING or PONG packet to the specified node, making sure to add enough
* gossip informations. */
void clusterSendPing(clusterLink *link, int type) {
- unsigned char buf[sizeof(clusterMsg)];
+ unsigned char buf[sizeof(clusterMsg)+sizeof(clusterMsgDataGossip)*3];
clusterMsg *hdr = (clusterMsg*) buf;
int gossipcount = 0, totlen;
/* freshnodes is the number of nodes we can still use to populate the