mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-04-19 04:22:49 +00:00
[PR #2012] [MERGED] fix(rust): Remove dead code returning pointer to stack variable #2813
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/2012
Author: @cfsmp3
Created: 1/10/2026
Status: ✅ Merged
Merged: 1/18/2026
Merged by: @cfsmp3
Base:
master← Head:fix/remove-dead-pmtentry-pointer-impl📝 Commits (1)
aac90d5fix(rust): Remove dead code returning pointer to stack variable📊 Changes
1 file changed (+0 additions, -44 deletions)
View changed files
📝
src/rust/src/ctorust.rs(+0 -44)📄 Description
Summary
Removes unused
impl FromCType<*mut PMT_entry> for *mut PMTEntrywhich contained a critical bug: returning a pointer to a stack-allocated value (undefined behavior).Problem
The deleted code did this:
When the function returns,
pmt_entryis destroyed and the pointer becomes dangling.Why delete instead of fix?
This code was never called anywhere in the codebase:
demuxer.rs:279uses the value-returning variant:PMTEntry::from_ctype(*buffer_ptr)Box::into_raw(Box::new(PMTEntry::from_ctype(...)?))Rather than fix dead buggy code (and introduce memory ownership complexity), just delete it.
Verification
Related
Supersedes #1988 which attempted to fix this bug rather than delete the dead code.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.