use correct data length (fixes segfault)
This commit is contained in:
parent
02665220ef
commit
8f378794d5
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue