mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-07-08 18:06:30 +00:00
[PR #1984] [CLOSED] fix: add NULL checks to Rust FFI exports #2788
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/1984
Author: @THE-Amrit-mahto-05
Created: 1/5/2026
Status: ❌ Closed
Base:
master← Head:fix-rust-ffi-null-checks📝 Commits (2)
5c5bc36fix: add NULL checks to Rust FFI exports25f6c39rustfmt: format FFI NULL safety tests📊 Changes
2 files changed (+82 additions, -28 deletions)
View changed files
📝
src/rust/src/libccxr_exports/bitstream.rs(+49 -28)📝
src/rust/src/libccxr_exports/mod.rs(+33 -0)📄 Description
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
Description
While reviewing the Rust FFI layer, I noticed several exported functions that
dereference raw pointers coming from C without checking for
NULL.If these functions are ever called with invalid inputs, this can lead to
undefined behavior.
I’m still learning Rust FFI, so please correct me if I’m misunderstanding
anything, but based on my understanding these look like genuine safety issues.
What this PR changes
NULLchecks to Rust FFI exports in:libccxr_exports/mod.rslibccxr_exports/bitstream.rsccxr_verify_crc320orNULL) instead of causing UBNULLpointersTesting
cargo testinsrc/rustfixed #1983
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.