bugaevc / pipe-channel

Channel implementation based on pipes
MIT License
2 stars 1 forks source link

Heads-up: UB due to misuse of mem::uninitialized will soon lead to panic #1

Closed RalfJung closed 4 years ago

RalfJung commented 4 years ago

Here, this crate causes UB by "Producing an invalid value". Concretely, it produces a value of an arbitrary type with mem::uninitialized(). In the near future the call to mem::uninitialized() will panic to avoid UB, and our crater run determined that this crate will be affected.

mem::uninitialized() is deprecated since Rust 1.39. The intended replacement is MaybeUninit, which tracks the possibility of uninitialized values at the type level to make sure the compiler does not make any false assumptions.

bugaevc commented 4 years ago

Hi! Thanks for the heads-up, I wanted to rewrite this code for quite some time already :slightly_smiling_face: