From 8f378794d5ef394506c73327ed4865d4805a4e2a Mon Sep 17 00:00:00 2001 From: Christian Ulrich Date: Mon, 5 Oct 2020 17:24:10 +0200 Subject: [PATCH] use correct data length (fixes segfault) --- examples/app/asyncutils.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/app/asyncutils.nim b/examples/app/asyncutils.nim index 30a716e..6b510d7 100644 --- a/examples/app/asyncutils.nim +++ b/examples/app/asyncutils.nim @@ -74,7 +74,7 @@ proc asyncRecvMsg*(fd: AsyncFD, size: int = BufferSize, var cmsg = ControlMessage(level: cmsgHeader.cmsg_level, msgType: cmsgHeader.cmsg_type, data: newString(dataLen)) - copyMem(cmsg.data.cstring, CMSG_DATA(cmsgHeader), cmsgHeader.cmsg_len) + copyMem(cmsg.data.cstring, CMSG_DATA(cmsgHeader), dataLen) cmsgs.add(cmsg) cmsgHeader = CMSG_NXTHDR(addr msg, cmsgHeader)