Skip to content
OpenAdvisories
Low GHSA-h5j3-crg5-8jqm RUSTSEC-2025-0106

orx-pinned-vec has undefined behavior in index_of_ptr with empty slices

Published Oct 21, 2025 · Updated Oct 28, 2025 · Assigned by GHSA

Description

The safe function `index_of_ptr` causes undefined behavior when called with an empty slice.

The issue occurs in the line `ptr.add(slice.len() - 1)` which underflows when `slice.len()` is 0, creating a pointer with a massive offset. According to Rust's safety rules, creating such a pointer causes immediate undefined behavior.

Affected packages

EcosystemPackageAffectedFixedRecord
crates.io orx-pinned-vec < 3.21.0 3.21.0 GHSA-h5j3-crg5-8jqm
crates.io orx-pinned-vec >= 0.0.0-0, < 3.21.0 3.21.0 RUSTSEC-2025-0106

References