aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2021-10-25 19:07:32 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2021-10-25 19:17:40 +0200
commitf147b5f617cbc64b47453b01419a4a568e007a64 (patch)
tree855fa8c76120e11c67eb526581b66e72eb743576
parent410a1be79eb12b20a421fef43d05ed9ec159985b (diff)
timeslot_fsm: Add assert to make sure we never go out of bounds in ts->lchan array
-rw-r--r--src/osmo-bsc/timeslot_fsm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/osmo-bsc/timeslot_fsm.c b/src/osmo-bsc/timeslot_fsm.c
index 76ac1af44..93fc38031 100644
--- a/src/osmo-bsc/timeslot_fsm.c
+++ b/src/osmo-bsc/timeslot_fsm.c
@@ -243,6 +243,7 @@ static void ts_setup_lchans(struct gsm_bts_trx_ts *ts)
ts->max_lchans_possible = max_lchans + max_lchans_vamos;
ts->max_primary_lchans = 0;
+ OSMO_ASSERT(ts->max_lchans_possible <= TS_MAX_LCHAN);
for (i = 0; i < ts->max_lchans_possible; i++) {
/* If we receive more than one Channel OPSTART ACK, don't fail on the second init. */
if (ts->lchan[i].fi)