PcapPlusPlus icon indicating copy to clipboard operation
PcapPlusPlus copied to clipboard

Fix read overflow

Open Marti2203 opened this issue 10 months ago • 1 comments

Fixes the following issue detected by OSS-Fuzz:

  • https://issues.oss-fuzz.com/issues/390004170

This fix was generated by CodeRover-S, an LLM agent for fixing security vulnerabilities. More details can be found at:

  • https://arxiv.org/pdf/2411.03346
  • https://github.com/AutoCodeRoverSG/auto-code-rover

Marti2203 avatar May 11 '25 07:05 Marti2203

Codecov Report

:x: Patch coverage is 27.27273% with 8 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 80.41%. Comparing base (e227b75) to head (bbbf25a). :warning: Report is 7 commits behind head on dev.

Files with missing lines Patch % Lines
Packet++/src/BgpLayer.cpp 37.50% 1 Missing and 4 partials :warning:
Packet++/src/RawPacket.cpp 0.00% 2 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1812      +/-   ##
==========================================
- Coverage   83.41%   80.41%   -3.00%     
==========================================
  Files         311      310       -1     
  Lines       55002    50938    -4064     
  Branches    12098    11848     -250     
==========================================
- Hits        45878    40963    -4915     
+ Misses       7889     7636     -253     
- Partials     1235     2339    +1104     
Flag Coverage Δ
alpine320 75.90% <25.00%> (-0.02%) :arrow_down:
fedora42 75.85% <25.00%> (-0.02%) :arrow_down:
macos-13 81.56% <30.00%> (-0.02%) :arrow_down:
macos-14 81.56% <30.00%> (-0.02%) :arrow_down:
macos-15 81.57% <30.00%> (-0.02%) :arrow_down:
mingw32 70.58% <25.00%> (-0.01%) :arrow_down:
mingw64 70.56% <25.00%> (+0.11%) :arrow_up:
npcap ?
rhel94 75.85% <22.22%> (-0.02%) :arrow_down:
ubuntu2004 60.14% <33.33%> (-0.04%) :arrow_down:
ubuntu2004-zstd 60.26% <33.33%> (+0.01%) :arrow_up:
ubuntu2204 75.79% <22.22%> (-0.02%) :arrow_down:
ubuntu2204-icpx 60.61% <30.00%> (-0.02%) :arrow_down:
ubuntu2404 75.90% <25.00%> (+0.01%) :arrow_up:
ubuntu2404-arm64 75.57% <25.00%> (+<0.01%) :arrow_up:
unittest 80.41% <27.27%> (-3.00%) :arrow_down:
windows-2022 ?
windows-2025 ?
winpcap ?
xdp 53.55% <22.22%> (-0.02%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar May 11 '25 20:05 codecov[bot]

Pushed an update. Feedback is appreciated!

Marti2203 avatar Jun 15 '25 11:06 Marti2203

Pushed an update. Feedback is appreciated!

@Marti2203 CI fails, can you please take a look?

seladb avatar Jun 15 '25 20:06 seladb

Hi @seladb Apologies for the super late response, will take care of it today

Marti2203 avatar Sep 22 '25 09:09 Marti2203

Thanks for the rerun, will check the results!

Marti2203 avatar Sep 24 '25 07:09 Marti2203

@seladb I have added Packet.h to fix the forward declaration issue. Would be happy to discuss a different solution but I think that it should not be a problem

Marti2203 avatar Sep 24 '25 16:09 Marti2203

@Marti2203 @danasana This PR should also cover this fix, am I wrong?

seladb avatar Oct 09 '25 07:10 seladb

@seladb , to my understanding it does similar checks. Can we test the example datapoint from clusterfuzz on the other PR to validate?

Marti2203 avatar Oct 09 '25 11:10 Marti2203

By the way, the current build failures do not look like something caused by the PR, correct?

Marti2203 avatar Oct 09 '25 11:10 Marti2203

@Marti2203 @danasana This PR should also cover this fix, am I wrong?

@seladb Yes, I believe so. I have tested the problematic scenario on my PR, and no errors occurred

danasana avatar Oct 09 '25 17:10 danasana

@Marti2203 @danasana This PR should also cover this fix, am I wrong?

@seladb Yes, I believe so. I have tested the problematic scenario on my PR, and no errors occurred

Thanks @danasana ! 🙏

seladb avatar Oct 16 '25 05:10 seladb

#1954 was just merged. @Marti2203 @danasana should we close this PR?

seladb avatar Oct 16 '25 05:10 seladb

Hi @seladb , yes, in this case the functionality has been implemented on a more broader level. I will close the PR

Marti2203 avatar Oct 28 '25 01:10 Marti2203