From 2553f6c9e53b900d23a19a46f0cd9b0303673297 Mon Sep 17 00:00:00 2001 From: antirez Date: Sat, 24 Jan 2015 07:52:24 +0100 Subject: [PATCH] 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(). --- src/cluster.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cluster.c b/src/cluster.c index 995f1663..66fc301c 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++; }