summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2015-01-24 07:52:24 +0100
committerantirez <antirez@gmail.com>2015-01-24 07:52:24 +0100
commit9802ec3c83cf6b61edad50bc41ddb3f6fdb13c6f (patch)
tree209cac7135d469f01459609f2f689d103f7be1b2
parent8aaf5075c5bb76492e56188090f33266d5a7ad46 (diff)
downloadredis-9802ec3c83cf6b61edad50bc41ddb3f6fdb13c6f.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 3381d98c8..2cbb21901 100644
--- a/src/cluster.c
+++ b/src/cluster.c
@@ -2150,6 +2150,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++;
}
totlen = sizeof(clusterMsg)-sizeof(union clusterMsgData);