- Reported
-
- Issued
-
- Package
-
zstd-safe
(crates.io)
- Type
-
INFO
Unsound
- Categories
-
- Keywords
-
#use-after-free
#lifetime
#dictionary
- References
-
- Patched
-
- Unaffected
-
- Affected Functions
- Version
zstd_safe::CCtx::init_using_cdict
-
zstd_safe::DCtx::init_using_ddict
-
Description
CCtx::init_using_cdict and DCtx::init_using_ddict (experimental
feature, deprecated) took the dictionary as &CDict<'b> and &DDict<'b>
with only 'b: 'a, so the dictionary itself could be dropped while the
context still pointed at it. The same mistake in other constructors was
fixed earlier (https://github.com/gyscos/zstd-rs/issues/365).
The flaw was corrected by taking &'a CDict<'b> and &'a DDict<'b>.
Advisory available under CC0-1.0
license.