-
Notifications
You must be signed in to change notification settings - Fork 684
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
Fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64110 #1236
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #1236 +/- ##
==========================================
- Coverage 82.74% 82.73% -0.01%
==========================================
Files 159 159
Lines 20302 20310 +8
Branches 7679 7681 +2
==========================================
+ Hits 16798 16803 +5
- Misses 2882 2885 +3
Partials 622 622
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Packet++/src/IPv4Layer.cpp
Outdated
{ | ||
if (GREv0Layer::isDataValid(payload, payloadLen)) | ||
m_NextLayer = new GREv0Layer(payload, payloadLen, this, m_Packet); | ||
} | ||
else if (greVer == GREv1) | ||
m_NextLayer = new GREv1Layer(payload, payloadLen, this, m_Packet); | ||
{ | ||
if (GREv1Layer::isDataValid(payload, payloadLen)) | ||
m_NextLayer = new GREv1Layer(payload, payloadLen, this, m_Packet); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit nicer to do:
if (greVer == GREv0 && GREv0Layer::isDataValid(payload, payloadLen))
m_NextLayer = new GREv0Layer(payload, payloadLen, this, m_Packet);
else if (greVer == GREv1 && GREv1Layer::isDataValid(payload, payloadLen))
m_NextLayer = new GREv1Layer(payload, payloadLen, this, m_Packet);
else
m_NextLayer = new PayloadLayer(payload, payloadLen, this, m_Packet);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it means if it is GREv0
and invalid, it will go to new PayloadLayer
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we always want to have a next layer... the default is PayloadLayer
if there is no better option...
Packet++/src/IPv6Layer.cpp
Outdated
{ | ||
if (GREv0Layer::isDataValid(payload, payloadLen)) | ||
m_NextLayer = new GREv0Layer(payload, payloadLen, this, m_Packet); | ||
} | ||
else if (greVer == GREv1) | ||
m_NextLayer = new GREv1Layer(payload, payloadLen, this, m_Packet); | ||
{ | ||
if (GREv1Layer::isDataValid(payload, payloadLen)) | ||
m_NextLayer = new GREv1Layer(payload, payloadLen, this, m_Packet); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
No description provided.