diff options
author | Alexander Chemeris <Alexander.Chemeris@gmail.com> | 2018-07-14 21:07:27 +0200 |
---|---|---|
committer | Ivan Kluchnikov <kluchnikovi@gmail.com> | 2018-09-05 16:08:34 +0300 |
commit | 50f7d74fca2b5e4121321e8411a2841bd8821eab (patch) | |
tree | ede0f78003c17d9a8408e351874de5cf13eee6e4 /src | |
parent | 94443261586312967ae7eb0cce8953977de457f1 (diff) |
coding: Always initialize bit counters in gsm0503_pdtch_egprs_decode().
Previsouly there were a lot of valid code paths which returned from the function
before setting bit counters which led to bogus BER output in osmo-bts-trx logs
when those code paths were hit.
Change-Id: I4722cae3794ccbb12001113c991d9cf345a52a96
Diffstat (limited to 'src')
-rw-r--r-- | src/coding/gsm0503_coding.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index 088b8bba..7385d233 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -938,6 +938,11 @@ int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, const sbit_t *bursts, uint16_t struct egprs_cps cps; union gprs_rlc_ul_hdr_egprs *hdr; + if (n_errors) + *n_errors = 0; + if (n_bits_total) + *n_bits_total = 0; + if ((nbits != GSM0503_GPRS_BURSTS_NBITS) && (nbits != GSM0503_EGPRS_BURSTS_NBITS)) { /* Invalid EGPRS bit length */ |