Commit 2c6dc9f1 authored by antirez's avatar antirez
Browse files

Make sure buffer is enough in clusterSendPing().

parent 722faed6
...@@ -2071,7 +2071,7 @@ void clusterBuildMessageHdr(clusterMsg *hdr, int type) { ...@@ -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 /* Send a PING or PONG packet to the specified node, making sure to add enough
* gossip informations. */ * gossip informations. */
void clusterSendPing(clusterLink *link, int type) { void clusterSendPing(clusterLink *link, int type) {
unsigned char buf[sizeof(clusterMsg)]; unsigned char buf[sizeof(clusterMsg)+sizeof(clusterMsgDataGossip)*3];
clusterMsg *hdr = (clusterMsg*) buf; clusterMsg *hdr = (clusterMsg*) buf;
int gossipcount = 0, totlen; int gossipcount = 0, totlen;
/* freshnodes is the number of nodes we can still use to populate the /* freshnodes is the number of nodes we can still use to populate the
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment