-
Notifications
You must be signed in to change notification settings - Fork 351
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 #815 from JOE1994/0109-arenavec
arenavec: potential double drop or uninitialized memory drop upon panic
- Loading branch information
Showing
1 changed file
with
20 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,20 @@ | ||
```toml | ||
[advisory] | ||
id = "RUSTSEC-0000-0000" | ||
package = "arenavec" | ||
date = "2021-01-12" | ||
url = "https://github.com/ibabushkin/arenavec/issues/1" | ||
categories = ["memory-corruption"] | ||
|
||
[versions] | ||
patched = [] | ||
``` | ||
|
||
# panic safety: double drop or uninitialized drop of T upon panic | ||
|
||
Affected versions of this crate did not guard against potential panics that may happen from user-provided functions `T::default()` and `T::drop()`. | ||
|
||
Panic within `T::default()` leads to dropping uninitialized `T`, when it is invoked from `common::Slice::<T, H>::new()`. | ||
Panic within `T::drop()` leads to double drop of `T`, when it is invoked either from `common::SliceVec::<T, H>::resize_with()` or `common::SliceVec::<T, H>::resize()` | ||
|
||
Either case causes memory corruption in the heap memory. |