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

Advisory: Possible double free in SmallVec::insert_many #30

Merged
merged 1 commit into from
Jul 20, 2018

Conversation

mbrubeck
Copy link
Contributor

@mbrubeck mbrubeck commented Jul 19, 2018

If an iterator passed to SmallVec::insert_many panicked in Iterator::next, destructors were run during unwinding while the vector was in an inconsistent state, possibly causing a double free (a destructor running on two copies of the same value).

This is fixed in smallvec 0.6.3 by ensuring that the vector's length is not updated to include moved items until they have been removed from their original positions. Items still may be leaked if Iterator::next panics, but they will not be dropped more than once.

For more details, see:

@tarcieri tarcieri merged commit 569e6ad into rustsec:master Jul 20, 2018
@Shnatsel
Copy link
Member

Thank you!

tarcieri added a commit that referenced this pull request Jul 20, 2018
@tarcieri
Copy link
Member

Assigned RUSTSEC-2018-0003 in 7855ffa

@tarcieri tarcieri added advisory security advisory PRs memory corruption attacker can modify memory labels Aug 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
advisory security advisory PRs memory corruption attacker can modify memory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants