summaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/gsm_04_08_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/libbsc/gsm_04_08_utils.c')
-rw-r--r--openbsc/src/libbsc/gsm_04_08_utils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/openbsc/src/libbsc/gsm_04_08_utils.c b/openbsc/src/libbsc/gsm_04_08_utils.c
index 98f079078..bc2bafc76 100644
--- a/openbsc/src/libbsc/gsm_04_08_utils.c
+++ b/openbsc/src/libbsc/gsm_04_08_utils.c
@@ -581,8 +581,11 @@ int gsm48_parse_meas_rep(struct gsm_meas_rep *rep, struct msgb *msg)
rep->dl.sub.rx_qual = (data[2] >> 1) & 0x7;
rep->num_cell = ((data[3] >> 6) & 0x3) | ((data[2] & 0x01) << 2);
- if (rep->num_cell < 1 || rep->num_cell > 6)
+ if (rep->num_cell < 1 || rep->num_cell > 6) {
+ /* There are no neighbor cell reports present. */
+ rep->num_cell = 0;
return 0;
+ }
/* an encoding nightmare in perfection */
mrc = &rep->cell[0];