From dced9c06198d6b80caf7aa6fe8cb865a562c12db Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 10 Feb 2014 15:54:19 +0100 Subject: [PATCH] Cluster: discard bus messages with version != 0. --- src/cluster.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cluster.c b/src/cluster.c index 44cb4765..8535da2f 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -1166,9 +1166,10 @@ int clusterProcessPacket(clusterLink *link) { type, (unsigned long) totlen); /* Perform sanity checks */ - if (totlen < 16) return 1; /* At least signature, totlen, count. */ + if (totlen < 16) return 1; /* At least signature, version, totlen, count. */ if (hdr->sig[0] != 'R' || hdr->sig[1] != 'C' || hdr->sig[2] != 'i' || hdr->sig[3] != 'b') return 1; /* Bad signature. */ + if (ntohs(hdr->ver) != 0) return 1; /* Can't handle versions other than 0. */ if (totlen > sdslen(link->rcvbuf)) return 1; if (type == CLUSTERMSG_TYPE_PING || type == CLUSTERMSG_TYPE_PONG || type == CLUSTERMSG_TYPE_MEET)