Recover panics from malformed SDF/PFD IE payloads#1181
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens PFCP parsing against panics triggered by malformed/truncated SDF Filter and PFD Contents IEs (notably in older go-pfcp versions), converting those panics into ordinary errors and adding regression coverage.
Changes:
- Add
recover()handling topdr.parseSDFFilterto prevent slice-bounds panics from crashing processing. - Introduce
parsePFDContentswrapper and route PFD management parsing through it to turn go-pfcp panics into errors. - Add unit tests covering malformed/truncated SDF Filter and PFD Contents payload handling.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pfcpiface/parse_pdr.go | Wrap SDF Filter parsing with recover() and return a normal error on malformed payloads. |
| pfcpiface/parse_pdr_test.go | Add test case for a truncated SDF Filter payload. |
| pfcpiface/messages_parse_test.go | Add test ensuring malformed PFD Contents payload returns an error (no panic). |
| pfcpiface/messages_conn.go | Add parsePFDContents panic-to-error wrapper and use it during PFD management request handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
thakurajayL
previously approved these changes
Jul 17, 2026
gab-arrobo
force-pushed
the
fix-malformed
branch
from
July 18, 2026 04:01
09eecff to
d5aa733
Compare
gab-arrobo
force-pushed
the
fix-malformed
branch
from
July 18, 2026 04:16
d5aa733 to
ada53cb
Compare
gab-arrobo
force-pushed
the
fix-malformed
branch
from
July 18, 2026 04:28
ada53cb to
f158f69
Compare
Signed-off-by: Arrobo, Gabriel <gabriel.arrobo@intel.com>
sureshmarikkannu
approved these changes
Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.