Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
RalfJung opened this issue Aug 31, 2020 · 0 comments

Comments

@RalfJung
Copy link

RalfJung commented Aug 31, 2020

Here, this crate causes UB by "Producing an invalid value". Concretely, it creates an arbitrary T 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. (Specifically, the test suite of this crate creates an unitialized String, which is invalid.)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant