mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-04 05:44:53 +00:00
Critical Rust memory safety bug: returning pointer to stack-allocated PMTEntry #894
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @THE-Amrit-mahto-05 on GitHub (Jan 6, 2026).
Description
While reviewing the Rust FFI layer, I found a use-after-scope (dangling pointer) bug in ctorust.rs.
An implementation of FromCType<*mut PMT_entry> returns a raw pointer derived from a stack-allocated Rust value, which becomes invalid immediately after the function returns.
This is undefined behavior in Rust, independent of C-side invariants, test coverage, or calling order.
Affected File: src/rust/src/ctorust.rs
Problematic Code
here
Proposed Fix
@cfsmp3 commented on GitHub (Jan 8, 2026):
Please don't open a ticket for these things - PRs are OK, but issues are for users to report problems. If a developer sees a problem he/she just sends a PR.