mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-04-19 04:22:49 +00:00
[PR #2049] Add safety checks to ccxr_verify_crc32 to prevent invalid pointer/length access #2862
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/2049
Author: @THE-Amrit-mahto-05
Created: 1/20/2026
Status: 🔄 Open
Base:
master← Head:fix-null-len-guard📝 Commits (1)
f147ac2re running for CI to pass checks📊 Changes
1 file changed (+4 additions, -0 deletions)
View changed files
📝
src/rust/src/libccxr_exports/mod.rs(+4 -0)📄 Description
…rc32
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
Description
ccxr_verify_crc32 is an extern "C" function that receives a raw pointer and a signed length from external (C) callers.
Previously, the function directly converted the inputs into a Rust slice using:
This is unsafe if:
A negative length cast to usize can wrap to a very large value, causing undefined behavior and potential crashes.
Fix
This prevents invalid inputs from reaching from_raw_parts and avoids potential crashes or memory safety issues.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.