arehbein has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/31972 )


Change subject: gsm_bts_check_ny1: Prevent possible division by zero
......................................................................

gsm_bts_check_ny1: Prevent possible division by zero

No minimal (positive) value is mentioned in 3GPP TS 44.018, so 0 is a 
configurable value for T3105

Fixes: Coverity scan CID#307389
Change-Id: I1fd0b92ab507a58fed6e9649eaa4770f1ad1cbad
---
M src/osmo-bsc/bts.c
1 file changed, 16 insertions(+), 0 deletions(-)



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

diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c
index 108c355..14bdce7 100644
--- a/src/osmo-bsc/bts.c
+++ b/src/osmo-bsc/bts.c
@@ -1726,6 +1726,10 @@
 {
        unsigned long T3105, ny1, ny1_recommended;
        T3105 = osmo_tdef_get(bts->network->T_defs, 3105, OSMO_TDEF_MS, -1);
+       if (!T3105) {
+               LOGP(DNM, LOGL_INFO, "T3105 is set to zero\n");
+               return false;
+       }
        ny1 = osmo_tdef_get(bts->network->T_defs, -3105, OSMO_TDEF_CUSTOM, -1);
        if (!(T3105 * ny1 > GSM_T3124_MAX + GSM_NY1_REQ_DELTA)) {
                /* See comment for GSM_NY1_DEFAULT */

--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31972
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I1fd0b92ab507a58fed6e9649eaa4770f1ad1cbad
Gerrit-Change-Number: 31972
Gerrit-PatchSet: 1
Gerrit-Owner: arehbein <[email protected]>
Gerrit-MessageType: newchange

Reply via email to