summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-08-13 22:45:40 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-08-25 23:19:35 +0200
commitff4ded5903fc13ad306dcda26dd9b41f922b3b84 (patch)
tree9fa977032ffee523442e0719bb0e67c3f68fbeb1
parent684908e167bd5352f7f97693ba36994e37d99a3a (diff)
bsc: Crash fix for the osmo-nitb/MNCC code
It is possible that MNCC sends a MNCC_LCHAN_MODIFY and wants a channel mode that is not possible on the current lchan, in that case a new channel is assigned. We now crash as the osmo-nitb is not having an assignment complete handler, add a NULL check.
-rw-r--r--openbsc/src/libbsc/bsc_api.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/openbsc/src/libbsc/bsc_api.c b/openbsc/src/libbsc/bsc_api.c
index 53d8113..d2965a2 100644
--- a/openbsc/src/libbsc/bsc_api.c
+++ b/openbsc/src/libbsc/bsc_api.c
@@ -378,7 +378,8 @@ static void handle_ass_compl(struct gsm_subscriber_connection *conn,
if (is_ipaccess_bts(conn->bts) && conn->lchan->tch_mode != GSM48_CMODE_SIGN)
rsl_ipacc_crcx(conn->lchan);
- api->assign_compl(conn, gh->data[0],
+ if (api->assign_compl)
+ api->assign_compl(conn, gh->data[0],
lchan_to_chosen_channel(conn->lchan),
conn->lchan->encr.alg_id,
chan_mode_to_speech(conn->lchan));