pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/38705?usp=email )
Change subject: ps_rab_ass_fsm: Fix uninitialized ptr access ......................................................................
ps_rab_ass_fsm: Fix uninitialized ptr access
/git/osmo-hnbgw/include/osmocom/hnbgw/context_map.h:211:9: error: 'rab' may be used uninitialized [-Werror=maybe-uninitialized] 211 | _map_rua_dispatch(MAP, EVENT, MSGB, __FILE__, __LINE__) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /git/osmo-hnbgw/src/osmo-hnbgw/ps_rab_ass_fsm.c:358:9: note: in expansion of macro 'map_rua_dispatch' 358 | map_rua_dispatch(rab->map, MAP_RUA_EV_TX_DIRECT_TRANSFER, msg); | ^~~~~~~~~~~~~~~~ /git/osmo-hnbgw/src/osmo-hnbgw/ps_rab_ass_fsm.c:297:24: note: 'rab' was declared here 297 | struct ps_rab *rab; | ^~~
Change-Id: Ifdcd4c369b35820c5c2beb695392d0b82d4ea34c --- M src/osmo-hnbgw/ps_rab_ass_fsm.c 1 file changed, 7 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/05/38705/1
diff --git a/src/osmo-hnbgw/ps_rab_ass_fsm.c b/src/osmo-hnbgw/ps_rab_ass_fsm.c index 456d5aa..f400fcc 100644 --- a/src/osmo-hnbgw/ps_rab_ass_fsm.c +++ b/src/osmo-hnbgw/ps_rab_ass_fsm.c @@ -294,7 +294,7 @@ /* See whether all information is in so that we can forward the modified RAB Assignment Request to RUA. */ static void ps_rab_ass_req_check_local_f_teids(struct ps_rab_ass *rab_ass) { - struct ps_rab *rab; + struct ps_rab *rab = NULL; RANAP_RAB_AssignmentRequestIEs_t *ies = &rab_ass->ranap_rab_ass_req_message->msg.raB_AssignmentRequestIEs; int i; struct msgb *msg; @@ -346,6 +346,12 @@ ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_RANAP_RAB_SetupOrModifyItemFirst, &first); }
+ if (!rab) { + LOG_PS_RAB_ASS(rab_ass, LOGL_ERROR, "Lookup PS RAB Assignment Request failed\n"); + ps_rab_ass_failure(rab_ass); + return; + } + /* Send the modified RAB Assignment Request to the hNodeB, wait for the RAB Assignment Response */ msg = ranap_rab_ass_req_encode(ies); if (!msg) {