The struct type of message(CLUSTERMSG_TYPE_MODULE) in the following code may be used incorrectly.

--------------file: cluster.c, function: clusterProcessPacket--------------------------

} else if (type == CLUSTERMSG_TYPE_MODULE) { uint32_t explen = sizeof(clusterMsg)-sizeof(union clusterMsgData); // should be sizeof(clusterMsgModule) ?? explen += sizeof(clusterMsgDataPublish) - 3 + ntohl(hdr->data.module.msg.len); if (totlen != explen) return 1; }


It didn't cause an error, because sizeof(clusterMsgDataPublish) is equal to sizeof(clusterMsgModule). I think this is a risk in later code maintenance.

Comment From: madolson

@hujiang001 I think you're right, looks like a simple oversight. Do you want submit a fix for it?

Comment From: hujiang001

@hujiang001 I think you're right, looks like a simple oversight. Do you want submit a fix for it?

ok,I will try to fix it later.