From f147b5f617cbc64b47453b01419a4a568e007a64 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 25 Oct 2021 19:07:32 +0200 Subject: timeslot_fsm: Add assert to make sure we never go out of bounds in ts->lchan array Related: OS#5278 Change-Id: I23a5349838e0c540fbb54cad10f2af42268d7729 --- src/osmo-bsc/timeslot_fsm.c | 1 + 1 file changed, 1 insertion(+) 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) -- cgit v1.2.3