Harald Welte has submitted this change and it was merged.

Change subject: trx: Don't call osmo_fr_check_sid with negative 'rc'
......................................................................


trx: Don't call osmo_fr_check_sid with negative 'rc'

In rx_tchf_fn(), if gsm0503_tch_fr_decode() returns a negative
result, we cannot use that result as length argument to
osmo_fr_check_sid()

Change-Id: Ic4080b5bf6c865be3333f923f19a2340e1e272c8
Fixes: Coverity CID#178659
---
M src/osmo-bts-trx/scheduler_trx.c
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 967e3db..c849dd5 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -1055,7 +1055,8 @@
                                                                : tch_mode) {
        case GSM48_CMODE_SPEECH_V1: /* FR */
                rc = gsm0503_tch_fr_decode(tch_data, *bursts_p, 1, 0, 
&n_errors, &n_bits_total);
-               lchan_set_marker(osmo_fr_check_sid(tch_data, rc), lchan); /* 
DTXu */
+               if (rc >= 0)
+                       lchan_set_marker(osmo_fr_check_sid(tch_data, rc), 
lchan); /* DTXu */
                break;
        case GSM48_CMODE_SPEECH_EFR: /* EFR */
                rc = gsm0503_tch_fr_decode(tch_data, *bursts_p, 1, 1, 
&n_errors, &n_bits_total);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic4080b5bf6c865be3333f923f19a2340e1e272c8
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder

Reply via email to