From 87482b335c79643f2908406f1fe29af4b759e595 Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Tue, 13 Aug 2019 17:06:17 +0200 Subject: iu_client: ensure UE is not NULL on CO primitives When ue_conn_ctx_find() can not find a UE it returns NULL. Change-Id: I63222fda6778417b1c986cb05772fecc51c43bb5 --- src/iu_client.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/iu_client.c b/src/iu_client.c index b5f3557..8da9a43 100644 --- a/src/iu_client.c +++ b/src/iu_client.c @@ -796,6 +796,9 @@ static int sccp_sap_up(struct osmo_prim_hdr *oph, void *_scu) LOGPIU(LOGL_DEBUG, "N-DISCONNECT.ind(%u)\n", prim->u.disconnect.conn_id); ue = ue_conn_ctx_find(prim->u.disconnect.conn_id); + if (!ue) + break; + rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); break; case OSMO_PRIM(OSMO_SCU_PRIM_N_DATA, PRIM_OP_INDICATION): @@ -804,6 +807,9 @@ static int sccp_sap_up(struct osmo_prim_hdr *oph, void *_scu) osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); /* resolve UE context */ ue = ue_conn_ctx_find(prim->u.data.conn_id); + if (!ue) + break; + rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); break; case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_INDICATION): -- cgit v1.2.3