Dangling reference in arc_swap::access::Map (#530)

This commit is contained in:
Michal 'vorner' Vaner
2020-12-11 19:09:15 +01:00
committed by GitHub
parent 4e0c71a0d6
commit 80d45a8d18

View File

@@ -0,0 +1,25 @@
```toml
[advisory]
id = "RUSTSEC-0000-0000"
package = "arc-swap"
date = "2020-12-10"
url = "https://github.com/vorner/arc-swap/issues/45"
categories = ["memory-corruption"]
keywords = ["dangling reference"]
[versions]
patched = [">= 1.1.0", ">= 0.4.8"]
unaffected = ["< 0.4.2"]
[affected]
functions = { "arc_swap::access::MapGuard::deref" = ["< 1.1.0"] }
```
# Dangling reference in `access::Map` with Constant
Using the `arc_swap::access::Map` with the `Constant` test helper (or with
user-provided implementation of the `Access` trait) could sometimes lead to the
map returning dangling references.
Replaced by implementation without `unsafe`, at the cost of added `Clone` bound
on the closure and small penalty on performance.