Skip to content

fix(sbi/consumer): nil-check JsonData on UEContextTransfer 200 response#214

Open
SAY-5 wants to merge 1 commit into
free5gc:mainfrom
SAY-5:say5/uectx-transfer-nil-jsondata-1045
Open

fix(sbi/consumer): nil-check JsonData on UEContextTransfer 200 response#214
SAY-5 wants to merge 1 commit into
free5gc:mainfrom
SAY-5:say5/uectx-transfer-nil-jsondata-1045

Conversation

@SAY-5
Copy link
Copy Markdown
Contributor

@SAY-5 SAY-5 commented May 2, 2026

Fixes free5gc/free5gc#1045.

UEContextTransferRequest indexed res.UeContextTransferResponse200.JsonData and immediately dereferenced it for the debug log, but JsonData is *UeContextTransferRspData,omitempty in the OpenAPI model. A source AMF returning a syntactically-valid 200 OK with the jsonData part absent, picked application/json over multipart/related, or sent an empty body, reached here with the pointer nil and the deref panicked the target AMF during cross-AMF UE mobility / 5G-GUTI re-registration.

Guard the deref and surface a clear UeContextTransfer 200 missing JsonData error so the caller can fall through to the foreign-GUAMI handling path instead of crashing.

@SAY-5 SAY-5 changed the title UEContextTransferRequest: nil-check JsonData on 200 response fix(sbi/consumer): nil-check JsonData on UEContextTransfer 200 response May 5, 2026
@SAY-5 SAY-5 closed this May 5, 2026
@SAY-5 SAY-5 reopened this May 5, 2026
@SAY-5
Copy link
Copy Markdown
Contributor Author

SAY-5 commented May 5, 2026

Updated PR title to match Conventional Commits format.

@SAY-5 SAY-5 force-pushed the say5/uectx-transfer-nil-jsondata-1045 branch from f368456 to f3574ba Compare May 5, 2026 21:30
@SAY-5
Copy link
Copy Markdown
Contributor Author

SAY-5 commented May 5, 2026

Amended commit message to match Conventional Commits format.

@d11nn
Copy link
Copy Markdown

d11nn commented May 6, 2026

@chchen7 @wiwi878 PTAL

@SAY-5
Copy link
Copy Markdown
Contributor Author

SAY-5 commented May 6, 2026

Done, trimmed verbose comments and moved context to the PR description. Thanks @roundspring2003!

@SAY-5 SAY-5 force-pushed the say5/uectx-transfer-nil-jsondata-1045 branch from 1d9f898 to f57d41c Compare May 6, 2026 21:34
@SAY-5
Copy link
Copy Markdown
Contributor Author

SAY-5 commented May 6, 2026

Squashed commits to fix Conventional Commits check.

@roundspring2003
Copy link
Copy Markdown
Contributor

@SAY-5 plz help to fix the conflict

Signed-off-by: SAY-5 <SAY-5@users.noreply.github.com>
@SAY-5 SAY-5 force-pushed the say5/uectx-transfer-nil-jsondata-1045 branch from f57d41c to 8dfd855 Compare May 19, 2026 20:12
@SAY-5
Copy link
Copy Markdown
Contributor Author

SAY-5 commented May 19, 2026

The branch currently shows as mergeable against main with all checks green, so there is no conflict to resolve right now. Let me know if anything else is needed.

ueContextTransferRspData = res.UeContextTransferResponse200.JsonData
if ueContextTransferRspData == nil {
logger.ConsumerLog.Warnln("UeContextTransfer 200 response missing JsonData")
err = openapi.ReportError("UeContextTransfer 200 missing JsonData")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @SAY-5 ,

I think it will be better to update the problem detail before the error return after we get in the nil error.

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.

[Bugs] AMF UEContextTransfer consumer JsonData nil dereference (cross-AMF mobility)

4 participants