libosmocore/src/gsm
Stefan Sperling e1a86748a2 fix cell identifier decoding in libosmocore
The cell ID list decoder merged in 11a4d9dd91
has a bug which was introduced part-way through the review process in
gerrit at https://gerrit.osmocom.org/#/c/6509/

When Neels suggested "why not just {...}id_list[MAXLEN] once?" I changed
the cell identifier list from a union of arrays to an array of unions.

After this change, elements smaller than the largest type in the union
were not laid out consecutively in memory anymore. E.g. uint16_t lac
values now occur at offsets of sizeof(id_list[0]) instead of offsets
of sizeof(uint16_t).

The problem is that I forgot to adjust the decoder accordingly, so the
decoder writes to the wrong offsets and returns cell identifier lists
which appear to contain uninitialized values when read back by API
consumers.

I found this problem while adding new regression tests to libosmocore to
test encoding and decoding. This commit adds one such tests for LAC list
decoding, which failed due to the above bug. I plan to write more tests,
however because this first test already uncovered a severe issue I chose
to submit a fix now and work on additional tests in later commits.

Change-Id: Ie1a5a9d858226be578cf11a03cf996d509bd51fb
Related: OS#2847
2018-03-15 18:27:30 +01:00
..
milenage add osmo_auth_c3() (separate from gsm_milenage()) 2017-12-18 23:05:24 +00:00
Makefile.am features: move bts feature related functionality to libosmocore 2018-03-02 16:54:16 +01:00
a5.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
abis_nm.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
apn.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
auth_comp128v1.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
auth_comp128v23.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
auth_core.c add osmo_auth_c3() (separate from gsm_milenage()) 2017-12-18 23:05:24 +00:00
auth_milenage.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
bts_features.c features: move bts feature related functionality to libosmocore 2018-03-02 16:54:16 +01:00
comp128.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
comp128v23.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
gan.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
gea.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
gprs_cipher_core.c Fix embedded build 2017-12-04 09:40:32 +00:00
gprs_gea.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
gprs_rlc.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
gsm48.c implement support for 3-digit MNC with leading zeros 2018-02-28 19:26:33 +01:00
gsm48_ie.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
gsm0341.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
gsm0411_smc.c SMS: Add value_string for TS 04.11 CP and RP state 2018-01-24 16:50:59 +01:00
gsm0411_smr.c SMS: Add value_string for TS 04.11 CP and RP state 2018-01-24 16:50:59 +01:00
gsm0411_utils.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
gsm0414.c doxygen: unify use of \file across the board 2017-06-23 00:18:23 +00:00
gsm0480.c gsm0480: parse optional IEs for RELEASE COMPLETE message 2018-01-17 10:45:41 +00:00
gsm0502.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
gsm0808.c support for more cell ID list types in libosmocore 2018-03-13 14:28:15 +01:00
gsm0808_utils.c fix cell identifier decoding in libosmocore 2018-03-15 18:27:30 +01:00
gsm23003.c fix osmo_mnc_from_str(): don't try to parse NULL 2018-03-05 04:27:40 +01:00
gsm_04_08_gprs.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
gsm_utils.c gsm: Use correct include for getrandom 2017-11-16 16:33:57 +01:00
gsup.c GSUP: change osmo_gsup_encode() return type 2018-02-05 13:03:42 +01:00
ipa.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
kasumi.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
lapd_core.c Log lapd_datalink state on errors 2018-01-16 17:07:45 +01:00
lapdm.c Fix malformed Abis/RSL messages with extra L3 Information field 2017-12-10 14:44:19 +00:00
libosmogsm.map support for more cell ID list types in libosmocore 2018-03-13 14:28:15 +01:00
mncc.c MNCC: Add MNCC to string dumper 2018-01-19 23:52:42 +01:00
oap.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
rsl.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
rxlev_stat.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
sysinfo.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
tlv_parser.c tlv_parser: Report *first* occurrence of repeated IEs 2018-02-09 02:02:42 +01:00