From f3ee8b2078f82a453ea01e5611ed95c9a4c3caa1 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 13 May 2022 17:03:51 +0200 Subject: [PATCH] ngap: fix invalid access of amf ID when context wasn't created yet --- srsgnb/src/stack/ngap/ngap_ue.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/srsgnb/src/stack/ngap/ngap_ue.cc b/srsgnb/src/stack/ngap/ngap_ue.cc index 714aa8a78..2ec6e4355 100644 --- a/srsgnb/src/stack/ngap/ngap_ue.cc +++ b/srsgnb/src/stack/ngap/ngap_ue.cc @@ -251,6 +251,11 @@ bool ngap::ue::send_ue_context_release_request(asn1::ngap::cause_c cause) return false; } + if (not ctxt.amf_ue_ngap_id.has_value()) { + logger.warning("Can't send release request. User 0x%x has no AMF UE Id.", ctxt.rnti); + return false; + } + if (was_ue_context_release_requested()) { // let timeout auto-remove user. return false;