Skip to content

Fix: Add NULL check after strdup in parse_segment_track_entry#2185

Open
sadiapeerzada wants to merge 2 commits intoCCExtractor:masterfrom
sadiapeerzada:master
Open

Fix: Add NULL check after strdup in parse_segment_track_entry#2185
sadiapeerzada wants to merge 2 commits intoCCExtractor:masterfrom
sadiapeerzada:master

Conversation

@sadiapeerzada
Copy link

strdup("eng") may return NULL if memory allocation fails.

This patch adds a NULL check after strdup and calls
fatal(EXIT_NOT_ENOUGH_MEMORY) to prevent a potential
NULL pointer dereference.

…) may return NULL if memory allocation fails. Added checks and call to fatal(EXIT_NOT_ENOUGH_MEMORY) to prevent potential NULL dereference.

Added memory allocation check for language string.
@sadiapeerzada sadiapeerzada marked this pull request as draft March 7, 2026 08:31
@sadiapeerzada sadiapeerzada marked this pull request as ready for review March 7, 2026 08:31
@ccextractor-bot
Copy link
Collaborator

CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit 90128d8...:
Report Name Tests Passed
Broken 13/13
CEA-708 14/14
DVB 6/7
DVD 3/3
DVR-MS 2/2
General 25/27
Hardsubx 1/1
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 81/86
Teletext 21/21
WTV 13/13
XDS 34/34

Your PR breaks these cases:

  • ccextractor --no-bom c83f765c66...
  • ccextractor --startcreditsnotafter 2 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9...

NOTE: The following tests have been failing on the master branch as well as the PR:

Congratulations: Merging this PR would fix the following tests:

  • ccextractor --parsePAT --out=srt c83f765c66..., Last passed: Never
  • ccextractor --startcreditsforatleast 1 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9..., Last passed: Never
  • ccextractor --startcreditsforatmost 2 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9..., Last passed: Never
  • ccextractor --endcreditsforatleast 3 --endcreditstext "CCextractor Ends crdit Testing" addf5e2fc9..., Last passed: Never

It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you).

Check the result page for more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants