From f6efb6cdec292f5f4891445346e9125965874f30 Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 3 Sep 2013 11:27:01 +0200 Subject: [PATCH] Cluster: fixed a bug in clusterSendPublish() due to inverted statements. The code used to copy the header *after* the 'hdr' pointer was already switched to the new buffer. Of course we need to do the reverse. --- src/cluster.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cluster.c b/src/cluster.c index 2afc62cc..bc0e34be 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -1380,8 +1380,8 @@ void clusterSendPublish(clusterLink *link, robj *channel, robj *message) { payload = buf; } else { payload = zmalloc(totlen); - hdr = (clusterMsg*) payload; memcpy(payload,hdr,sizeof(*hdr)); + hdr = (clusterMsg*) payload; } memcpy(hdr->data.publish.msg.bulk_data,channel->ptr,sdslen(channel->ptr)); memcpy(hdr->data.publish.msg.bulk_data+sdslen(channel->ptr),