From 95e5d95fafc4672fbf8f614273c17e45784828f1 Mon Sep 17 00:00:00 2001 From: Sukchan Lee Date: Thu, 26 Jan 2023 20:48:55 +0900 Subject: [PATCH] [AMF] Fixed crashes from malformed 5GS-ID (#2020) --- src/amf/context.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/amf/context.c b/src/amf/context.c index 7b6d5abd3..4ead83d29 100644 --- a/src/amf/context.c +++ b/src/amf/context.c @@ -1620,7 +1620,12 @@ amf_ue_t *amf_ue_find_by_message(ogs_nas_5gs_message_t *message) } suci = ogs_nas_5gs_suci_from_mobile_identity(mobile_identity); - ogs_assert(suci); + if (!suci) { + ogs_error("Cannot get the SUCI from Mobilie Identity"); + ogs_log_hexdump(OGS_LOG_ERROR, + mobile_identity->buffer, mobile_identity->length); + return NULL; + } amf_ue = amf_ue_find_by_suci(suci); if (amf_ue) {