orx-pinned-vec has undefined behavior in index_of_ptr with empty slices
Low severity
GitHub Reviewed
Published
Oct 21, 2025
to the GitHub Advisory Database
•
Updated Oct 21, 2025
Description
Published to the GitHub Advisory Database
Oct 21, 2025
Reviewed
Oct 21, 2025
Last updated
Oct 21, 2025
The safe function
index_of_ptrcauses undefined behavior when called with an empty slice.The issue occurs in the line
ptr.add(slice.len() - 1)which underflows whenslice.len()is 0, creating a pointer with a massive offset. According to Rust's safety rules, creating such a pointer causes immediate undefined behavior.References