← Rule catalog

rust-doctor · Security

ffi-cstring-lifetime

Detect CString pointers stored or returned after the owner is dropped

Severity
warning
Confidence
medium
Analyzer
syn-ast
Default policy
Opt-in

Tags

  • heuristic
  • security

Framework requirements

No framework requirement.

Limitations

  • Syntactic analysis does not have rustc name resolution or inferred type information.

Remediation

Bind the CString owner before taking its pointer and keep that binding alive.

Fix capability: guidance