summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2015-01-24 07:52:24 +0100
committerantirez <antirez@gmail.com>2015-01-29 15:52:23 +0100
commitf2cd2fcdb7cd96e9aaaba57b1c49b680c8ac3298 (patch)
tree24a9f99f4dffd275b56c6e79433f9f49e3c02635
parent147df6f035236fbbe86b6f6e9906ca5571fffe3c (diff)
downloadredis-f2cd2fcdb7cd96e9aaaba57b1c49b680c8ac3298.tar.gz
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().
-rw-r--r--src/cluster.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cluster.c b/src/cluster.c
index 995f16633..66fc301cc 100644
--- a/src/cluster.c
+++ b/src/cluster.c
@@ -2195,6 +2195,8 @@ void clusterSendPing(clusterLink *link, int type) {
memcpy(gossip->ip,this->ip,sizeof(this->ip));
gossip->port = htons(this->port);
gossip->flags = htons(this->flags);
+ gossip->notused1 = 0;
+ gossip->notused2 = 0;
gossipcount++;
}