Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

alexhuszagh/rust-lexical
main @ afb2efa
2
Fixes
0
CVEs
HIGH
Peak severity
Highlights
Memory Safety: 2 prior fixes. Scrutinize any change in this area.
lexical-util: most-fixed (2 issues). Treat as high-risk during review.
2 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

Memory Safety: Unsafe pointer manipulation using non-overlapping copies and uninitialized memory (`MaybeUninit`) can lead to out-of-bounds memory access and undefined behavior if buffers are not strictly validated. Replacing these with safe primitives prevents memory corruption.
Memory Safety: Implementing performance-critical iterator traits like `BytesIter` without proper safety guarantees allows safe code to trigger undefined behavior via incorrect pointer offsets. Marking the trait itself as `unsafe` ensures the compiler forces developers to guarantee implementation invariants.