From e4cef833d0857804de9a00c6bf12919aecc4c8b9 Mon Sep 17 00:00:00 2001 From: kpl Date: Mon, 16 Jun 2014 11:09:55 -0700 Subject: [PATCH] cmRtNet.c : Updated _cmRtNetDeserializeSyncMsg() to use cmRtNetSyncMsg_t.hdrByteCnt. --- cmRtNet.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmRtNet.c b/cmRtNet.c index 71537a9..d7b9110 100644 --- a/cmRtNet.c +++ b/cmRtNet.c @@ -282,9 +282,15 @@ cmRtNetRC_t _cmRtNetSerializeSyncMsg( cmRtNet_t* p, const cmRtNetSyncMsg_t* m, v cmRtNetRC_t _cmRtNetDeserializeSyncMsg( const void* buf, unsigned n, cmRtNetSyncMsg_t* m ) { - assert( n > sizeof(*m)); - memcpy(m,buf,sizeof(*m)); const cmRtNetSyncMsg_t* mp = (const cmRtNetSyncMsg_t*)buf; + + m->hdr.rtSubIdx = mp->hdr.rtSubIdx; + m->hdr.selId = mp->hdr.selId; + m->selId = mp->selId; + m->hdrByteCnt = sizeof(cmRtNetSyncMsg_t); + m->rtSubIdx = mp->rtSubIdx; + m->id = mp->id; + const cmChar_t* s = ((const cmChar_t*)(mp)) + mp->hdrByteCnt; m->label = cmMemAllocStr(s); return kOkNetRC;