Security context

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

rust-windowing/android-ndk-rs
master @ 244337b
2
Fixes
0
CVEs
HIGH
Peak severity
100.0%
Coverage
Highlights
Race Condition: 1 prior fix. Scrutinize any change in this area.
ndk-context/src/lib.rs: most-fixed (1 issue). Treat as high-risk during review.
1 high-severity fix in this history; regressions here are high-impact.
Recurring patterns

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

Race Condition: Callbacks from NDK are invoked on separate threads; without Send bounds, data races and undefined behavior can occur. The fix required Send and reordered drops, indicating the pattern is easy to miss in new code.
Use After Free: The ANDROID_CONTEXT static can outlive the activity, leading to dangling pointers. The fix clears it on destroy; any code reading this static without lifecycle awareness risks UAF.