Closed
Description
I'm doing an audit of Tokio, and as part of it, we noticed in tokio-rs/tokio#4685 there are a few places where tokio is casting a &mut [MaybeUninit<u8>]
to a &mut [u8]
. They then pass this slice to a variety of mio methods.
If I'm reading the unsafe guidelines correctly, this is undefined behavior, or at least considered potentially undefined behavior.
Would it be possible to add some methods that accept &mut [MaybeUninit<u8>]
to mio? That would let us shrink down the audit scope to these methods to make sure that mio won't accidentally read from these bytes. It'd also give us a place to easily migrate the ecosystem once the standard library is able to take &mut [MaybeUninit<u8>]
, or std::io::ReadBuf
once stabilized.
Metadata
Metadata
Assignees
Labels
No labels