mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-03 21:23:48 +00:00
[PR #1987] [CLOSED] Fix pmtentry dangling pointer #2789
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?
📋 Pull Request Information
Original PR: https://github.com/CCExtractor/ccextractor/pull/1987
Author: @THE-Amrit-mahto-05
Created: 1/6/2026
Status: ❌ Closed
Base:
master← Head:fix-pmtentry-dangling-pointer📝 Commits (4)
5c5bc36fix: add NULL checks to Rust FFI exports25f6c39rustfmt: format FFI NULL safety testsdc8d01dfix(rust-ffi): avoid returning pointer to stack-allocated PMTEntry46dbc77actully that time i forget to run rustfmt📊 Changes
3 files changed (+114 additions, -30 deletions)
View changed files
📝
src/rust/src/ctorust.rs(+32 -2)📝
src/rust/src/libccxr_exports/bitstream.rs(+49 -28)📝
src/rust/src/libccxr_exports/mod.rs(+33 -0)📄 Description
[FIX] Critical Rust FFI memory safety: avoid returning pointer to stack-allocated PMTEntry
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
Description
PR fixes a use-after-scope (dangling pointer) bug in the Rust FFI layer.
The implementation of:
previously returned a raw pointer derived from a stack-allocated PMTEntry.
Once the function returned, the stack frame was destroyed, leaving the pointer
dangling and causing undefined behavior in Rust.
This is a correctness and memory-safety issue independent of C-side usage,
tests, or call order.
Fixes #1986
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.