Closed
Description
@faern noted this in https://internals.rust-lang.org/t/why-are-socketaddrv4-socketaddrv6-based-on-low-level-sockaddr-in-6/13321
Lines 78 to 85 in 27fbd5f
As far as I can tell there are no guarantees from std
about the layout of SocketAddrV{4,6}
, and this code could silently compile and cause UB elsewhere if the representation changes (e.g. if padding is added early on in the struct, resulting in C code reading uninitialized bytes).