From adec82f3b1c725e8a70d327b9592940fbdeaaff7 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 10 Jan 2022 14:04:31 +0100 Subject: [PATCH] iu_client: Prevent crash if msgb passed to ranap_iu_tx has no dst Related: OS#5398 Change-Id: I64beecd2c492d6312f60a1cf016ef022cda5252d --- src/iu_client.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/iu_client.c b/src/iu_client.c index da433daa..7d299030 100644 --- a/src/iu_client.c +++ b/src/iu_client.c @@ -461,6 +461,12 @@ int ranap_iu_tx(struct msgb *msg_nas, uint8_t sapi) struct msgb *msg; struct osmo_scu_prim *prim; + if (!uectx) { + LOGPIU(LOGL_ERROR, "Discarding to-be-transmitted L3 Message as RANAP DT with unset dst SCCP conn_id!\n", + uectx->conn_id); + return -ENOTCONN; + } + LOGPIU(LOGL_INFO, "Transmitting L3 Message as RANAP DT (SCCP conn_id %u)\n", uectx->conn_id);