mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-04 05:44:53 +00:00
[PR #1803] [MERGED] fix(xds_decoder): prevent buffer overruns and fix sprintf logic bug #2542
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/1803
Author: @cfsmp3
Created: 12/13/2025
Status: ✅ Merged
Merged: 12/13/2025
Merged by: @cfsmp3
Base:
master← Head:fix/xds-decoder-buffer-overruns📝 Commits (1)
79acc02fix(xds_decoder): prevent buffer overruns and fix sprintf logic bug📊 Changes
1 file changed (+40 additions, -16 deletions)
View changed files
📝
src/lib_ccx/ccx_decoders_xds.c(+40 -16)📄 Description
Summary
This PR fixes multiple buffer overrun vulnerabilities and a logic bug in the XDS (Extended Data Services) decoder in
src/lib_ccx/ccx_decoders_xds.c.Issues Found and Fixed
1. Unsafe
sprintfCalls (10 instances)All
sprintfcalls into fixed-size static buffers were replaced withsnprintfusingsizeof():xds_do_copy_generation_management_systemcopy_permitedsnprintf(..., sizeof(copy_permited), ...)xds_do_copy_generation_management_systemapssnprintf(..., sizeof(aps), ...)xds_do_copy_generation_management_systemrcdsnprintf(..., sizeof(rcd), ...)xds_do_content_advisoryagesnprintf(..., sizeof(age), ...)xds_do_content_advisoryratingsnprintf(..., sizeof(rating), ...)(3 locations)xds_do_content_advisorycontentsnprintf(..., sizeof(content), ...)2. Unsafe
strcpy/strcatChain inxds_do_content_advisoryBefore:
After:
3. Unsafe
strcpyinto Fixed-Size Context BuffersTwo
strcpycalls into 33-byte context structure fields were replaced with bounded copies:xds_do_current_and_futurexds_program_description[line_num][33]strncpy(..., 32)+ null terminatorxds_do_channelcurrent_xds_network_name[33]strncpy(..., 32)+ null terminator4. Logic Bug in
xds_do_private_data(CRITICAL)Before (BUG):
This was a logic bug where each iteration overwrote the buffer instead of appending. The output would only contain the last byte instead of all bytes.
After (FIXED):
Code Changes Summary
sprintf()callsstrcpy()callsstrcat()callssnprintf()callsstrncpy()callsSecurity Impact
These fixes prevent:
XDS data comes from closed caption streams in broadcast video, which could potentially be manipulated in adversarial scenarios.
Test Plan
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.