From 98439edd85882bf9e8377f78af1bd5f63ba0212a Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Mon, 9 Nov 2020 16:54:13 +0100 Subject: osmo_bsc_bssap: actually check for lchan The function bssmap_handle_cipher_mode() suggests to check if an lchan is actually present when it gets called, but it only checks for conn. This might lead to a segfault later in the execution path. Change-Id: I3103ec89cd6dce1a11ea8e9f8187373e4114e852 --- src/osmo-bsc/osmo_bsc_bssap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index f168b6501..63dee9e3d 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -487,7 +487,7 @@ static int bssmap_handle_cipher_mode(struct gsm_subscriber_connection *conn, uint8_t enc_bits_msc; int chosen_cipher; - if (!conn) { + if (!conn || !conn->lchan) { LOGP(DMSC, LOGL_ERROR, "No lchan/msc_data in cipher mode command.\n"); return -1; } -- cgit v1.2.3