fix(sbi/consumer): nil-check JsonData on UEContextTransfer 200 response#214
Conversation
|
Updated PR title to match Conventional Commits format. |
f368456 to
f3574ba
Compare
|
Amended commit message to match Conventional Commits format. |
|
Done, trimmed verbose comments and moved context to the PR description. Thanks @roundspring2003! |
1d9f898 to
f57d41c
Compare
|
Squashed commits to fix Conventional Commits check. |
|
@SAY-5 plz help to fix the conflict |
f57d41c to
8dfd855
Compare
|
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") |
There was a problem hiding this comment.
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.
8dfd855 to
3326301
Compare
|
Set problemDetails before the missing-JsonData return so callers see a system-failure detail instead of nil (4aeb12b). |
4aeb12b to
7cc80e1
Compare
|
Hi @SAY-5 , |
Signed-off-by: SAY-5 <SAY-5@users.noreply.github.com>
…nData Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
7cc80e1 to
8050843
Compare
|
@Alonza0314 LGTM, I've rebased this branch to the latest main branch and passed in IT System. |
Fixes free5gc/free5gc#1045.
UEContextTransferRequestindexedres.UeContextTransferResponse200.JsonDataand immediately dereferenced it for the debug log, butJsonDatais*UeContextTransferRspData,omitemptyin the OpenAPI model. A source AMF returning a syntactically-valid 200 OK with thejsonDatapart absent, pickedapplication/jsonovermultipart/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 JsonDataerror so the caller can fall through to the foreign-GUAMI handling path instead of crashing.