[PATCH] osmo-bsc[master]: HO: process_meas_rep: guard against modulo zero

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Feb 15 13:05:14 UTC 2018


Review at  https://gerrit.osmocom.org/6461

HO: process_meas_rep: guard against modulo zero

Fixes: CID#182318
Change-Id: I3ad9d01cbffa287adce55b3569667b58a2d3556b
---
M src/libbsc/handover_decision.c
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/61/6461/1

diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c
index 19fb3ab..40f85c0 100644
--- a/src/libbsc/handover_decision.c
+++ b/src/libbsc/handover_decision.c
@@ -321,6 +321,9 @@
 
 	/* 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);
 

-- 
To view, visit https://gerrit.osmocom.org/6461
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3ad9d01cbffa287adce55b3569667b58a2d3556b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>


More information about the gerrit-log mailing list