# GHSA-5m39-wx2q-mxg3: Invalid use of `mem::uninitialized` causes `use-of-uninitialized-value`

- Severity: Medium (rating, scored by GitHub)
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2022-10-22T12:00:00.000Z
- Modified: 2023-11-08T04:15:48.003Z
- Also known as: RUSTSEC-2022-0067

## 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.

(As written by GitHub Advisory Database.)

## Affected

- lzf (crates.io): before 0.3.2; from 0.0.0-0 before 0.3.2

## References

- <https://github.com/badboy/lzf-rs/issues/9> (report, web)
- <https://github.com/badboy/lzf-rs/commit/b633bf265e41c60dfce3be7eac4e4dd5e18d06cf> (web)
- <https://github.com/badboy/lzf-rs> (package)
- <https://rustsec.org/advisories/RUSTSEC-2022-0067.html> (advisory, web)
- <https://crates.io/crates/lzf> (package)

## Sources

- GitHub Advisory Database: [GHSA-5m39-wx2q-mxg3](https://github.com/advisories/GHSA-5m39-wx2q-mxg3), CC-BY-4.0, modified 2023-11-08
- RustSec Advisory Database: [RUSTSEC-2022-0067](https://rustsec.org/advisories/RUSTSEC-2022-0067.html), CC0-1.0, modified 2023-11-08

---

Page: https://cve.day/GHSA-5m39-wx2q-mxg3 · Whole record: https://cve.day/GHSA-5m39-wx2q-mxg3.json · Rebuilt by cve.day 2026-11-25T22:56:43.114Z
