aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-02-12 21:16:44 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2018-02-16 16:11:16 +0100
commitb57ff5ab8501564deef13812bcf28c1eba56d9bc (patch)
tree1dd514afcabf363c0c85f8554e37ab1c4f3970cb
parentb037053413b43c7ad85f58ceb1d98350250ce6b0 (diff)
HO: process_meas_rep: guard against modulo zero
Fixes: CID#182318 Change-Id: I3ad9d01cbffa287adce55b3569667b58a2d3556b
-rw-r--r--src/libbsc/handover_decision.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c
index 19fb3ab41..40f85c0ed 100644
--- a/src/libbsc/handover_decision.c
+++ b/src/libbsc/handover_decision.c
@@ -321,6 +321,9 @@ static int process_meas_rep(struct gsm_meas_rep *mr)
/* Power Budget AKA Better Cell */
pwr_interval = ho_get_pwr_interval(bts->ho);
+ /* handover_cfg.h defines pwr_interval as [1..99], but since we're using it in a modulo below,
+ * assert non-zero to clarify. */
+ OSMO_ASSERT(pwr_interval);
if ((mr->nr % pwr_interval) == pwr_interval - 1)
return attempt_handover(mr);