You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, read takes a &mut [u8]. That's fine for many use cases, but it does require the buffer to be initialized before calling read, so it's currently not possible to read directly into uninitialized memory.
For Mustang, the C read API takes a raw pointer which may be pointing to an uninitialized buffer. Currently mustang does slice::from_raw_parts_mut, however this has undefined behavior if the slice is uninitialized.
The text was updated successfully, but these errors were encountered:
Mustang is now using temporary buffers to avoid having UB, but it could avoid this overhead if rustix had a way to read into uninitialized buffers directly.
Currently,
read
takes a&mut [u8]
. That's fine for many use cases, but it does require the buffer to be initialized before callingread
, so it's currently not possible to read directly into uninitialized memory.For Mustang, the C
read
API takes a raw pointer which may be pointing to an uninitialized buffer. Currently mustang doesslice::from_raw_parts_mut
, however this has undefined behavior if the slice is uninitialized.The text was updated successfully, but these errors were encountered: