Merge pull request #778 from jonasbb/heapless

heapless: use-after-free when cloning partially consumed Iterator
This commit is contained in:
Sergey "Shnatsel" Davidoff
2021-02-27 02:03:32 +01:00
committed by GitHub

View File

@@ -0,0 +1,23 @@
```toml
[advisory]
id = "RUSTSEC-0000-0000"
package = "heapless"
date = "2010-11-02"
url = "https://github.com/japaric/heapless/issues/181"
categories = ["memory-corruption", "memory-exposure"]
keywords = ["use-after-free"]
informational = "unsound"
[affected.functions]
"heapless::vec::IntoIter::clone" = ["<= 0.6"]
[versions]
patched = []
```
# Use-after-free when cloning a partially consumed `Vec` iterator
The `IntoIter` `Clone` implementation clones the whole underlying `Vec`.
If the iterator is partially consumed the consumed items will be copied, thus creating a use-after-free access.
A proof of concept is available in the original bug report.