From: antirez Date: Tue, 24 Apr 2012 09:28:10 +0000 (+0200) Subject: Fixed a bug in propagation of PUBLISH via the cluster bus. X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/21661d7acc9ed525c1150f6fa55646d19f5a31d9 Fixed a bug in propagation of PUBLISH via the cluster bus. This bug was spotted by clang on FreeBSD. --- diff --git a/src/cluster.c b/src/cluster.c index 07552c18..e87ca45a 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -902,7 +902,7 @@ void clusterSendPublish(clusterLink *link, robj *channel, robj *message) { } else { payload = zmalloc(totlen); hdr = (clusterMsg*) payload; - memcpy(payload,hdr,sizeof(hdr)); + memcpy(payload,hdr,sizeof(*hdr)); } memcpy(hdr->data.publish.msg.bulk_data,channel->ptr,sdslen(channel->ptr)); memcpy(hdr->data.publish.msg.bulk_data+sdslen(channel->ptr),