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

need to return here to prevent segfault #1052

Merged
merged 1 commit into from Jun 15, 2021

Conversation

spencersevilla
Copy link
Contributor

I recently encountered a strange situation where the UPF was given a junk packet and segfaulted. I am still investigating the cause of the junk packet (looks like encapsulation, might have more PRs later) but in the meantime, the segfault was caused at line 198 as a result of calling src_addr[k] when src_addr was never set.

I dont know the exact pfcp logic and am not clear if we should return NULL or OGS_ERROR. This seemed correct but I defer to your wisdom. On a related note, I am assuming/hoping that we should free the packet somewhere else along the line to avoid leaks?

@acetcom acetcom merged commit 449b5b4 into open5gs:main Jun 15, 2021
acetcom added a commit that referenced this pull request Jun 15, 2021
@acetcom
Copy link
Member

acetcom commented Jun 15, 2021

@spencersevilla

You made a good point. I've modified it a little to use 'continue' instead of 'return'.

Thank you so much!
Sukchan

@spencersevilla spencersevilla deleted the handle_invalid_packet branch July 21, 2021 18:53
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.

None yet

2 participants