# RUSTSEC-2022-0021: SegQueue creates zero value of any type

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

## Also published as

- [GHSA-6888-WF7J-34JQ](https://cve.now/GHSA-6888-WF7J-34JQ.md) (GitHub)

## Affected versions

- crossbeam-queue (crates.io): fixed in 0.2.3

## Description

Affected versions of this crate called `mem::zeroed()` to create values of a user-supplied type `T`.
This is unsound e.g. if `T` is a reference type (which must be non-null).
 
The flaw was corrected by avoiding the use of `mem::zeroed()`, using `MaybeUninit` instead.

## References

- https://crates.io/crates/crossbeam-queue
- https://rustsec.org/advisories/RUSTSEC-2022-0021.html
- https://github.com/crossbeam-rs/crossbeam/pull/458

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

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