Commit 9802ec3c authored by antirez's avatar antirez
Browse files

Cluster: initialized not used fileds in gossip section.

Otherwise we risk sending not initialized data to other nodes, that may
contain anything. This was actually not possible only because the
initialization of the buffer where the cluster packets header is created
was larger than the 3 gossip sections we use, so the memory was already
all filled with zeroes by the memset().
parent 8aaf5075
...@@ -2150,6 +2150,8 @@ void clusterSendPing(clusterLink *link, int type) { ...@@ -2150,6 +2150,8 @@ void clusterSendPing(clusterLink *link, int type) {
memcpy(gossip->ip,this->ip,sizeof(this->ip)); memcpy(gossip->ip,this->ip,sizeof(this->ip));
gossip->port = htons(this->port); gossip->port = htons(this->port);
gossip->flags = htons(this->flags); gossip->flags = htons(this->flags);
gossip->notused1 = 0;
gossip->notused2 = 0;
gossipcount++; gossipcount++;
} }
totlen = sizeof(clusterMsg)-sizeof(union clusterMsgData); totlen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
......
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