Change in osmo-bsc[master]: range_enc_determine_range(): Don't dereference array on size=0

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Oct 21 12:11:54 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/11397 )

Change subject: range_enc_determine_range(): Don't dereference array on size=0
......................................................................

range_enc_determine_range(): Don't dereference array on size=0

Change-Id: I5bbb10af8b8e8ebc22bf79f5468e71a41b5e74b3
Fixes: Coverity CID#182710
---
M src/osmo-bsc/arfcn_range_encode.c
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/src/osmo-bsc/arfcn_range_encode.c b/src/osmo-bsc/arfcn_range_encode.c
index 84f9f63..54d98a9 100644
--- a/src/osmo-bsc/arfcn_range_encode.c
+++ b/src/osmo-bsc/arfcn_range_encode.c
@@ -168,6 +168,10 @@
 {
 	int max = 0;
 
+	/* don't dereference arfcns[] array if size is 0 */
+	if (size == 0)
+		return ARFCN_RANGE_128;
+
 	/*
 	 * Go for the easiest. And pick arfcns[0] == f0.
 	 */

-- 
To view, visit https://gerrit.osmocom.org/11397
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I5bbb10af8b8e8ebc22bf79f5468e71a41b5e74b3
Gerrit-Change-Number: 11397
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181021/0d843ab1/attachment.htm>


More information about the gerrit-log mailing list