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
This commit is contained in:
Philipp Maier 2020-11-09 16:54:13 +01:00
parent 47899f1695
commit 98439edd85
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}