# RUSTSEC-2022-0049: Use after free in MacOS / iOS implementation

- Database: RustSec
- Published: 2022-08-15
- Modified: 2023-11-08

## Also published as

- [GHSA-3FG9-HCQ5-VXRC](https://cve.now/GHSA-3FG9-HCQ5-VXRC.md) (GitHub)

## Affected versions

- iana-time-zone (crates.io): from 0.1.43, fixed in 0.1.45

## Description

In iana-time-zone v0.1.43 a use-after-free bug in the MacOS / iOS implementation was introduced.

The copied system time zone was released before its name was copied.
If the system time zone was changed between the call of `CFRelease` and `str::to_owned()`,
random memory would be copied.

## References

- https://crates.io/crates/iana-time-zone
- https://rustsec.org/advisories/RUSTSEC-2022-0049.html
- https://github.com/strawlab/iana-time-zone/pull/54
- https://github.com/strawlab/iana-time-zone/pull/50#discussion_r945353515

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

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