From 9c62fc69a8eb9f72da054f908704acbb14a6caa6 Mon Sep 17 00:00:00 2001 From: Stefan Sperling Date: Fri, 16 Mar 2018 10:23:34 +0100 Subject: fix bug in parse_cell_id_ci_list() Cell ID lists with CI were misparsed because parse_cell_id_ci_list() failed to report the amount of consumed bytes to its caller. Also add a regression test which uncovered the bug. Change-Id: Ife4e485e2b86c6f3321c9700611700115ad247b2 Depends: If6b941720de33dca66b6b1aa2cb95a3275708b7f Related: OS#2847 --- src/gsm/gsm0808_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index ac1e8520..0165e8af 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -756,7 +756,7 @@ static int parse_cell_id_ci_list(struct gsm0808_cell_id_list2 *cil, const uint8_ if (i >= GSM0808_CELL_ID_LIST2_MAXLEN) return -ENOSPC; cil->id_list[i++].ci = osmo_load16be(ci_be++); - consumed += elemlen; + *consumed += elemlen; remain -= elemlen; } return i; -- cgit v1.2.3