embassy icon indicating copy to clipboard operation
embassy copied to clipboard

net: UB in TcpSocket

Open Dirbaio opened this issue 4 years ago • 0 comments

The lifetime transmute here is UB

https://github.com/embassy-rs/embassy/blob/a361050224e561fcd682041981307f9c49293eeb/embassy-net/src/tcp_socket.rs#L139-L143

The justification in thecomment is bogus, because even if the TcpSocket doesn't "touch" these bytes, it has a &mut to them, which is already UB.

Dirbaio avatar Aug 05 '21 20:08 Dirbaio