Skip to content

[IMPROVEMENT] Standardize number_bytes upper bound in ts_tables_epg.c#2252

Closed
THE-Amrit-mahto-05 wants to merge 10 commits intoCCExtractor:masterfrom
THE-Amrit-mahto-05:fix/epg-number-bytes-bound
Closed

[IMPROVEMENT] Standardize number_bytes upper bound in ts_tables_epg.c#2252
THE-Amrit-mahto-05 wants to merge 10 commits intoCCExtractor:masterfrom
THE-Amrit-mahto-05:fix/epg-number-bytes-bound

Conversation

@THE-Amrit-mahto-05
Copy link
Copy Markdown
Contributor

@THE-Amrit-mahto-05 THE-Amrit-mahto-05 commented Apr 2, 2026

In raising this pull request, I confirm the following (please check boxes):

Reason for this PR:

  • This PR adds new functionality.
  • This PR fixes a bug that I have personally experienced or that a real user has reported and for which a sample exists.
  • This PR is porting code from C to Rust.

Sanity check:

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • If the PR adds new functionality, I've added it to the changelog. If it's just a bug fix, I have NOT added it to the changelog.
  • I am NOT adding new C code unless it's to fix an existing, reproducible bug.

Reason

In ts_tables_epg.c, the variable number_bytes had inconsistent upper bounds:

  • One check allowed values < 500
  • Another restricted it to < 200

This inconsistency can lead to unsafe memory handling and unpredictable parsing behavior.

Change

Standardized the upper bound to 200 to match existing validation logic.

Repro instructions

This change improves consistency and safety in bounds checking.
No specific crash case was reproduced, but inconsistent limits were observed in code.

why 200

The value 200 is already used in another validation block in the same file
(compression_type/mode check), so this change ensures consistency and avoids arbitrary limits.

Proof of warning when it was 500:
1
2

after chaning to 200:
solve

@THE-Amrit-mahto-05
Copy link
Copy Markdown
Contributor Author

THE-Amrit-mahto-05 commented Apr 2, 2026

@cfsmp3
Could you please close this PR? I realized it includes unintended changes from build artifacts, which affected multiple files.
I’ll open a fresh PR with only the intended change in ts_tables_epg.c.

@cfsmp3
Copy link
Copy Markdown
Contributor

cfsmp3 commented Apr 4, 2026

Closing — duplicate of #2253, and bundles unrelated Rust parser changes.

@cfsmp3 cfsmp3 closed this Apr 4, 2026
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