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:17 +0100
commit2553f6c9e53b900d23a19a46f0cd9b0303673297 (patch)
tree24a9f99f4dffd275b56c6e79433f9f49e3c02635
parent2616d6f6dc6f5ccaae8069bf491fc00c6c823a4c (diff)
downloadredis-2553f6c9e53b900d23a19a46f0cd9b0303673297.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++;
}