# RUSTSEC-2022-0067: Invalid use of mem::uninitialized causes use-of-uninitialized-value

- Database: RustSec
- Published: 2022-10-22
- Modified: 2023-11-08

## Also published as

- [GHSA-5M39-WX2Q-MXG3](https://cve.now/GHSA-5M39-WX2Q-MXG3.md) (GitHub)

## Affected versions

- lzf (crates.io): fixed in 0.3.2

## Description

The compression and decompression function used `mem:uninitialized`
to create an array of uninitialized values, to later write values into it.
This later leads to reads from uninitialized memory.

The flaw was corrected in commit b633bf265e41c60dfce3be7eac4e4dd5e18d06cf
by using a heap-allocated `Vec` and removing out use of `mem::uninitialized`.
The fix was released in v0.3.2 and v1.0.0

Subsequently the crate was deprecated and its use is discouraged.

## References

- https://crates.io/crates/lzf
- https://rustsec.org/advisories/RUSTSEC-2022-0067.html
- https://github.com/badboy/lzf-rs/issues/9

Page: https://cve.now/RUSTSEC-2022-0067

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
