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
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 @@
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 @@
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):