summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2021-02-16 20:21:22 +0100
committerHarald Welte <laforge@osmocom.org>2021-02-16 20:43:56 +0100
commitdd9fb84b5844aacafd65888e3da28321613cb01e (patch)
tree671485d5287d0277f910d0cd6f0fafef476389a4
parenta8dc198705bedd5b684fe0ed5737b1d8f35de37a (diff)
sgsn: Fix regression regarding g_pars.bssgp.cell_id[] array overflow
This was introduced in I7d859fd710dba96eb9b46c428243281183e1be12 and caused Iu related TTCN3 tests to fail with: SGSN_Tests.ttcn:771 Dynamic test case error: Index overflow in a value of type @SGSN_Tests.BssgpCellIds: The index is 3, but the value has only 3 elements. Change-Id: Iaae0015f5e7c7eabc426add91b5de1b63bf6d9f6
-rw-r--r--sgsn/SGSN_Tests.ttcn4
1 files changed, 3 insertions, 1 deletions
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index c6e22ccc..b79aae40 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -768,7 +768,9 @@ function f_upd_ptmsi_and_tlli(OCT4 p_tmsi, integer ran_index := 0) runs on BSSGP
function f_process_attach_accept(PDU_GMM_AttachAccept aa, integer ran_index := 0) runs on BSSGP_ConnHdlr {
/* mandatory IE */
var hexstring aa_plmn := f_RAI_to_plmn_hexstr(aa.routingAreaIdentification);
- if (not (g_pars.bssgp_cell_id[ran_index].ra_id.lai.mcc_mnc == aa_plmn)) {
+ /* we cannot use ran_index here, as it would overflow the cell_id object, since ran_idx > NUM_GB
+ * indicates an Iu RAN connection. All cells are expected to run the same MCC/MNC anyway... */
+ if (not (g_pars.bssgp_cell_id[0].ra_id.lai.mcc_mnc == aa_plmn)) {
setverdict(fail, "mismatching PLMN in Attach Accept: " & hex2str(aa_plmn)
& "; expected " & hex2str(g_pars.bssgp_cell_id[ran_index].ra_id.lai.mcc_mnc));
mtc.stop;