GHSA-wm8x-php5-hvq6
JSON

medium

Maligned causes incorrect deallocation

Severity
medium rating by GitHub
Published
Last changed
Also known as
RUSTSEC-2023-0017

Description

maligned::align_first manually allocates with an alignment larger than T, and then uses Vec::from_raw_parts on that allocation to get a Vec<T>.

GlobalAlloc::dealloc requires that the layout argument must be the same layout that was used to allocate that block of memory.

When deallocating, Box and Vec may not respect the specified alignment and can cause undefined behavior.

Affected

Product or packageVersionsReported by
maligned (crates.io)up to 0.2.1, from 0.0.0-0GitHub Advisory Database, RustSec Advisory Database

References

Sources

SourceRecordLicence
GitHub Advisory DatabaseGHSA-wm8x-php5-hvq6 changed 2023-11-08CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2023-0017 changed 2023-11-08CC0-1.0