mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-04-18 12:03:00 +00:00
[PR #1805] fix(encoders): replace sprintf/strcpy with bounds-checked versions #2549
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?
Original Pull Request: https://github.com/CCExtractor/ccextractor/pull/1805
State: closed
Merged: Yes
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