jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/34969?usp=email )
Change subject: SI10: Fix uninitialized last_i index ......................................................................
SI10: Fix uninitialized last_i index
Not only l_bts must be declared outside the for-loop, but also last_i.
This is a fixup of I9dbbd066075f9ccb331616a2b59b46b1b44c8b4c.
Related: CID#330311 Change-Id: Ia10c5e68cb2940d9360d78f606af25bb207ee55f --- M src/osmo-bsc/system_information.c 1 file changed, 16 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/69/34969/1
diff --git a/src/osmo-bsc/system_information.c b/src/osmo-bsc/system_information.c index 141a720..cc2e788 100644 --- a/src/osmo-bsc/system_information.c +++ b/src/osmo-bsc/system_information.c @@ -1422,7 +1422,7 @@ { struct bitvec *nbv; struct gsm_bts *s_bts = conn->lchan->ts->trx->bts, *l_bts = NULL; - int i; + int i, last_i = -1; bool any_neighbor = false; int rc;
@@ -1447,7 +1447,6 @@ struct gsm_subscriber_connection *c; unsigned int save_cur_bit; int16_t arfcn; - int last_i; arfcn = neigh_list_get_arfcn(s_bts, nbv, i); /* End of list */ if (arfcn < 0) @@ -1478,7 +1477,7 @@ save_cur_bit = bv.cur_bit; /* Nth neighbor, so add rest octets with differential cell info. */ LOGP(DRR, LOGL_INFO, "Append cell ID %d to SI 10.\n", n_bts->cell_identity); - OSMO_ASSERT(l_bts); + OSMO_ASSERT(l_bts && last_i >= 0); rc = si10_rest_octets_encode_other(s_bts, &bv, l_bts, n_bts, last_i, i); if (rc < 0) { LOGP(DRR, LOGL_INFO, "Skip cell ID %d, SI 10 would overflow.\n",