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

Prevent nil pointer derefrence when handling backupAMF #119

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

brianchennn
Copy link
Contributor

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have read the CONTRIBUTING document.
  • Each of my commits messages include Signed-off-by: Author Name <authoremail@example.com> to accept the DCO.

@brianchennn brianchennn changed the title Pr/bugfix Prevent nil pointer derefrence when handling backupAMF Apr 17, 2024
uePool.Range(func(k, v any) bool {
ue, ok := v.(*context.GNBUe)
if !ok {
if backupAmf != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for your PR!
Indentation is becoming a bit too big here, we should do that to avoid adding one layer of indentation:

if backupAmf == nil {
  return
}
amfPool.Range(func(k, v any) bool {
...

Copy link
Contributor Author

@brianchennn brianchennn Apr 17, 2024

Choose a reason for hiding this comment

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

OK. I have fixed it.

BTW, I found that when decoding AMFStatusIndication NGAP Message, if backupAMFName IE is included in value. The error: per data out of range will happen. I think there's a bug in free5gc/aper and I am going to fix it.

Signed-off-by: brianchennn <ny40ny40ny.cs11@nycu.edu.tw>
@linouxis9 linouxis9 merged commit 578563b into HewlettPackard:main Apr 17, 2024
9 checks passed
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.

2 participants