Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pcapng option bounds check #4699

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tf2spi
Copy link

@tf2spi tf2spi commented Mar 19, 2025

This PR fixes an off-by-one bounds check for PCAPNG options parsing. It uses < when <= is also acceptable, meaning the last option of valid PCAPNG files could be missed. For most files, it's end-of-option anyways, but this option need not be present.

This PR also adds a regression test which fails the assertion without the change and succeeds with the change.

Bounds check in PcapNG options is off-by-one, meaning that tightly packed options accidentally truncate the last option. Use right comparison to get that last option.
Copy link

codecov bot commented Mar 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.59%. Comparing base (7106b01) to head (aaabdf0).
Report is 35 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4699      +/-   ##
==========================================
- Coverage   81.64%   78.59%   -3.06%     
==========================================
  Files         359      336      -23     
  Lines       86235    81627    -4608     
==========================================
- Hits        70409    64157    -6252     
- Misses      15826    17470    +1644     

see 291 files with indirect coverage changes

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@guedou guedou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR!

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