Closed
Description
On macOS (and maybe other systems?) cmsg data is 4-byte aligned. In 64-bit macOS environments, libc::timeval
contains 8-byte values, and is presumably 8-byte aligned. ControlMessage
directly converts the pointer to the cmsg data into a typed reference, which is therefore apparently unaligned and incurs UB. It seems like the only safe thing to do here would be to use ptr::read_unaligned
.
Metadata
Metadata
Assignees
Labels
No labels