Skip to content
New issue

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

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

Already on GitHub? # to your account

vec_deque::Iter has unsound Debug implementation #53566

Closed
RalfJung opened this issue Aug 21, 2018 · 1 comment · Fixed by #53571
Closed

vec_deque::Iter has unsound Debug implementation #53566

RalfJung opened this issue Aug 21, 2018 · 1 comment · Fixed by #53571

Comments

@RalfJung
Copy link
Member

Found by @MaloJaffre: The following code causes UB (not observable through crashes, but still):

use std::collections::VecDeque;
fn main() {
    println!("{:?}", VecDeque::<u32>::new().iter());
}

This will create a VecDeque ring with capacity 8, then turn that into a slice for Iter, and then print that entire slice. Run it in Miri to see for yourself (Miri is in the "tools" menu).

@shepmaster shepmaster changed the title vec_deque::Iter has unsound Debig implementation vec_deque::Iter has unsound Debug implementation Aug 21, 2018
MaloJaffre added a commit to MaloJaffre/rust that referenced this issue Aug 22, 2018
bors added a commit that referenced this issue Aug 23, 2018
Fix unsoundness for VecDeque

 See individual commit for more details.

r? @RalfJung.

Fixes #53566, fixes #53529
@nluedtke
Copy link

This was assigned CVE-2019-1010299.

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

Successfully merging a pull request may close this issue.

2 participants