VTY: fix NULL-pointer dereference in 'show transceiver'

Change-Id: I403a027f064a4898eb74a11381bab3c884ec8ccf
This commit is contained in:
Vadim Yanitskiy 2022-04-07 23:35:15 +03:00
parent 1422a80cae
commit 0fb9517fed
1 changed files with 5 additions and 0 deletions

View File

@ -89,11 +89,16 @@ DEFUN(show_transceiver, show_transceiver_cmd, "show transceiver",
else
vty_out(vty, " bsic : undefined%s", VTY_NEWLINE);
/* trx->ts[tn].priv is NULL in absence of the A-bis connection */
if (trx->rsl_link == NULL)
continue;
for (tn = 0; tn < ARRAY_SIZE(trx->ts); tn++) {
const struct gsm_bts_trx_ts *ts = &trx->ts[tn];
const struct l1sched_ts *l1ts = ts->priv;
const struct trx_sched_multiframe *mf;
OSMO_ASSERT(l1ts != NULL);
mf = &trx_sched_multiframes[l1ts->mf_index];
vty_out(vty, " timeslot #%u (%s)%s",