# GHSA-5M39-WX2Q-MXG3: Invalid use of mem::uninitialized causes use-of-uninitialized-value

- Database: GitHub
- Severity: medium (stated by ghsa, no CVSS score)
- Published: 2022-11-08
- Modified: 2023-11-08

## Also published as

- [RUSTSEC-2022-0067](https://cve.now/RUSTSEC-2022-0067.md) (RustSec)

## 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://github.com/badboy/lzf-rs/issues/9
- https://github.com/badboy/lzf-rs/commit/b633bf265e41c60dfce3be7eac4e4dd5e18d06cf
- https://github.com/badboy/lzf-rs
- https://rustsec.org/advisories/RUSTSEC-2022-0067.html

Page: https://cve.now/GHSA-5M39-WX2Q-MXG3

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