From f46c66ec9ae53ad5602bbf0ab043a70e80a9e960 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 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);