ADVISORIES

RustSec Advisory Database

RUSTSEC-2021-0049

`through` and `through_and` causes a double free if the map function panics

Details

through and through_and take a mutable reference as well as a mapping function to change the provided reference. They do this by calling ptr::read on the reference which duplicates ownership and then calling the mapping function.

If the mapping function panics, both the original object and the one duplicated by ptr::read get dropped, causing a double free.

Affected packages

EcosystemPackageAffected versions
crates.iothrough
From 0.0.0-0, no fix listed

References