mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-03 21:23:48 +00:00
[PR #1805] [MERGED] fix(encoders): replace sprintf/strcpy with bounds-checked versions #2545
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/1805
Author: @cfsmp3
Created: 12/13/2025
Status: ✅ Merged
Merged: 12/13/2025
Merged by: @cfsmp3
Base:
master← Head:fix/phase3-buffer-safety-sami-srt-mp4-webvtt📝 Commits (1)
a43cb99fix(encoders): replace sprintf/strcpy with bounds-checked versions📊 Changes
4 files changed (+61 additions, -48 deletions)
View changed files
📝
src/lib_ccx/ccx_encoders_sami.c(+17 -17)📝
src/lib_ccx/ccx_encoders_srt.c(+9 -9)📝
src/lib_ccx/ccx_encoders_webvtt.c(+27 -13)📝
src/lib_ccx/mp4.c(+8 -9)📄 Description
Summary
This PR continues the Phase 3 buffer safety work from the bug analysis plan, replacing unsafe string functions with bounds-checked alternatives:
sprintf→snprintfconversionssprintf→snprintfconversionssprintf/strcpy/strcat→snprintfformat_duration()where 20-byte buffer was too small for long duration strings (e.g., "365 Days, 23:59:59.999" = 22+ chars)format_duration()functionsprintf→snprintfconversions, plus:+4instead of+5for null terminator)css_file_nameandoutline_css_fileTest plan
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.