aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-08-16 11:13:51 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-08-23 02:08:36 +0200
commit2d8683e6385d349e23d08e7e09fcb6099ca68f87 (patch)
tree3660e716850f9025968c8b7c3aaacff4e8dc3a5a
parent9d14724b2024f48914205f272a02fd6cfddee522 (diff)
fixup: fix possible null pointer deref
Check for nullpointer - just to be sure, there was no crash at this point.
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_sigtran.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_sigtran.c b/openbsc/src/osmo-bsc/osmo_bsc_sigtran.c
index dc6d84bee..0f6ca334f 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_sigtran.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_sigtran.c
@@ -377,7 +377,12 @@ int osmo_bsc_sigtran_del_conn(struct osmo_bsc_sccp_con *conn)
/* Send an USSD notification in case we loose the connection to the MSC */
static void bsc_notify_msc_lost(const struct osmo_bsc_sccp_con *conn)
{
- struct gsm_subscriber_connection *subscr_conn = conn->conn;
+ struct gsm_subscriber_connection *subscr_conn;
+
+ /* Check if sccp conn is still present */
+ if (!conn)
+ return;
+ subscr_conn = conn->conn;
/* send USSD notification if string configured and conn->data is set */
if (!subscr_conn)