[PR #1799] [MERGED] fix(ts_tables_epg): add NULL checks and fix memory leaks #2535

Open
opened 2026-01-29 17:22:39 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/1799
Author: @cfsmp3
Created: 12/12/2025
Status: Merged
Merged: 12/13/2025
Merged by: @cfsmp3

Base: masterHead: fix/ts-tables-epg-memory-safety


📝 Commits (1)

  • 9eb2669 fix(ts_tables_epg): add NULL checks and fix memory leaks

📊 Changes

1 file changed (+64 additions, -2 deletions)

View changed files

📝 src/lib_ccx/ts_tables_epg.c (+64 -2)

📄 Description

Summary

  • EPG_output_live: add NULL checks for filename/finalfilename malloc, add fopen failure check
  • EPG_DVB_decode_string: add NULL checks for decode_buffer and out malloc
  • EPG_decode_content_descriptor: add NULL check for categories malloc
  • EPG_decode_parental_rating_descriptor: add NULL check for ratings malloc
  • EPG_decode_extended_event_descriptor: add NULL checks for net and extended_text malloc
  • EPG_ATSC_decode_multiple_string: add NULL checks for event_name and text malloc
  • parse_EPG_packet: add NULL check for buffer malloc, fix unsafe realloc that lost original pointer on failure
  • EPG_decode_short_event_descriptor: fix memory leak - free event_name on early return
  • EPG_DVB_decode_EIT: fix memory leak - call EPG_free_event on early return

All OOM conditions now use fatal(EXIT_NOT_ENOUGH_MEMORY, ...) following the project's coding patterns.

Test plan

  • Build succeeds
  • Run with EPG extraction to verify no regressions

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/CCExtractor/ccextractor/pull/1799 **Author:** [@cfsmp3](https://github.com/cfsmp3) **Created:** 12/12/2025 **Status:** ✅ Merged **Merged:** 12/13/2025 **Merged by:** [@cfsmp3](https://github.com/cfsmp3) **Base:** `master` ← **Head:** `fix/ts-tables-epg-memory-safety` --- ### 📝 Commits (1) - [`9eb2669`](https://github.com/CCExtractor/ccextractor/commit/9eb266914a7e4c3f4a337b4e76e8d4152636a0da) fix(ts_tables_epg): add NULL checks and fix memory leaks ### 📊 Changes **1 file changed** (+64 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/lib_ccx/ts_tables_epg.c` (+64 -2) </details> ### 📄 Description ## Summary - **EPG_output_live**: add NULL checks for filename/finalfilename malloc, add fopen failure check - **EPG_DVB_decode_string**: add NULL checks for decode_buffer and out malloc - **EPG_decode_content_descriptor**: add NULL check for categories malloc - **EPG_decode_parental_rating_descriptor**: add NULL check for ratings malloc - **EPG_decode_extended_event_descriptor**: add NULL checks for net and extended_text malloc - **EPG_ATSC_decode_multiple_string**: add NULL checks for event_name and text malloc - **parse_EPG_packet**: add NULL check for buffer malloc, fix unsafe realloc that lost original pointer on failure - **EPG_decode_short_event_descriptor**: fix memory leak - free event_name on early return - **EPG_DVB_decode_EIT**: fix memory leak - call EPG_free_event on early return All OOM conditions now use `fatal(EXIT_NOT_ENOUGH_MEMORY, ...)` following the project's coding patterns. ## Test plan - [x] Build succeeds - [ ] Run with EPG extraction to verify no regressions 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 17:22:39 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2535