GHSA-h5j3-crg5-8jqm: orx-pinned-vec has undefined behavior in index_of_ptr with empty slices
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.
References
Code Behaviors & Features
Detect and mitigate GHSA-h5j3-crg5-8jqm with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →