-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #832 from ammaraskar/insert_many
Add advisory for double-free in insert_many
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
```toml | ||
[advisory] | ||
id = "RUSTSEC-0000-0000" | ||
package = "insert_many" | ||
date = "2021-01-26" | ||
url = "https://github.com/rphmeier/insert_many/issues/1" | ||
categories = ["memory-corruption"] | ||
keywords = ["memory-safety", "double-free"] | ||
|
||
[versions] | ||
patched = [] | ||
``` | ||
|
||
# insert_many can drop elements twice on panic | ||
|
||
Affected versions of `insert_many` used `ptr::copy` to move over items in a | ||
vector to make space before inserting, duplicating their ownership. It then | ||
iterated over a provided `Iterator` to insert the new items. | ||
|
||
If the iterator's `.next()` method panics then the vector would drop the same | ||
elements twice. |