Advisory

RUSTSEC-2021-0052

Also known as: CVE-2021-30455, CVE-2021-30456, CVE-2021-30457, GHSA-8gmx-cpcg-f8h5, GHSA-rccq-j2m7-8fwr, GHSA-vfqx-hv88-f9cv

Summary

Multiple functions can cause double-frees

Details

The following functions in the crate are affected:

IdMap::clone_from

The clone_from implementation for IdMap drops the values present in the
map and then begins cloning values from the other map. If a .clone() call
pancics, then the afformentioned dropped elements can be freed again.

get_or_insert

get_or_insert reserves space for a value, before calling the user provided
insertion function f. If the function f panics then uninitialized or
previously freed memory can be dropped.

remove_set

When removing a set of elements, ptr::drop_in_place is called on each of the
element to be removed. If the Drop impl of one of these elements panics then
the previously dropped elements can be dropped again.

Severity

Not rated by the source.

Dates

Published
2021-02-26 12:00 UTC
Modified
2024-03-15 00:05 UTC

Affected packages and fixes

id-map

crates.io · All systems

Affected

  • introduced 0.0.0-0 (semver)

Fixed versions

None listed

Fix

No fixed version is listed.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences