aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2020-11-09 16:54:13 +0100
committerPhilipp Maier <pmaier@sysmocom.de>2020-11-09 16:55:47 +0100
commit98439edd85882bf9e8377f78af1bd5f63ba0212a (patch)
tree33d02fab2b4e1e640e26a6e3da8826a53ac64790 /src/osmo-bsc
parent47899f1695b59a8d81162a513ff649a834b1fd0b (diff)
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
Diffstat (limited to 'src/osmo-bsc')
-rw-r--r--src/osmo-bsc/osmo_bsc_bssap.c2
1 files changed, 1 insertions, 1 deletions
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;
}