Skip to content

Recover panics from malformed SDF/PFD IE payloads#1181

Merged
gab-arrobo merged 1 commit into
omec-project:mainfrom
gab-arrobo:fix-malformed
Jul 20, 2026
Merged

Recover panics from malformed SDF/PFD IE payloads#1181
gab-arrobo merged 1 commit into
omec-project:mainfrom
gab-arrobo:fix-malformed

Conversation

@gab-arrobo

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 to pdr.parseSDFFilter to prevent slice-bounds panics from crashing processing.
  • Introduce parsePFDContents wrapper 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.

Comment thread pfcpiface/parse_pdr.go
Comment thread pfcpiface/messages_conn.go
thakurajayL
thakurajayL previously approved these changes Jul 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread pfcpiface/parse_pdr.go Outdated
Copilot AI review requested due to automatic review settings July 18, 2026 04:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread pfcpiface/parse_pdr.go
Comment thread pfcpiface/messages_conn.go
Copilot AI review requested due to automatic review settings July 18, 2026 04:28
Signed-off-by: Arrobo, Gabriel <gabriel.arrobo@intel.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@gab-arrobo
gab-arrobo requested review from a team and thakurajayL July 18, 2026 04:35
@gab-arrobo
gab-arrobo merged commit 12b4e00 into omec-project:main Jul 20, 2026
14 checks passed
@gab-arrobo
gab-arrobo deleted the fix-malformed branch July 20, 2026 04:42
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.

4 participants