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

pespin gerrit-no-reply at lists.osmocom.org
Tue Jun 1 12:02:46 UTC 2021


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/24496 )


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

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

cherry-picked from osmo-bsc.git d4c391eab03ce768d7eaf483368d9cda4f9668df

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



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/96/24496/1

diff --git a/src/gsm/gsm48_arfcn_range_encode.c b/src/gsm/gsm48_arfcn_range_encode.c
index 6423a9a..cb06d04 100644
--- a/src/gsm/gsm48_arfcn_range_encode.c
+++ b/src/gsm/gsm48_arfcn_range_encode.c
@@ -166,6 +166,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/c/libosmocore/+/24496
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Iae058c35506bc25c9f4790889b89ac46aea664b6
Gerrit-Change-Number: 24496
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210601/edeb980e/attachment.htm>


More information about the gerrit-log mailing list