Skip to content

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