aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/csn1.cpp1
-rw-r--r--src/gsm_rlcmac.cpp3
2 files changed, 4 insertions, 0 deletions
diff --git a/src/csn1.cpp b/src/csn1.cpp
index 45cc848..7f64823 100644
--- a/src/csn1.cpp
+++ b/src/csn1.cpp
@@ -89,6 +89,7 @@ csnStreamInit(csnStream_t* ar, gint bit_offset, gint remaining_bits_len)
{
ar->remaining_bits_len = remaining_bits_len;
ar->bit_offset = bit_offset;
+ ar->direction = 0;
}
static const char* ErrCodes[] =
diff --git a/src/gsm_rlcmac.cpp b/src/gsm_rlcmac.cpp
index a39a5c0..44bc5e1 100644
--- a/src/gsm_rlcmac.cpp
+++ b/src/gsm_rlcmac.cpp
@@ -34,6 +34,7 @@
*/
#include <iostream>
#include <cstdlib>
+#include <assert.h>
#include <gprs_debug.h>
using namespace std;
@@ -5436,6 +5437,7 @@ void decode_gsm_rlcmac_uplink_data(bitvec * vector, RlcMacUplinkDataBlock_t * da
}
unsigned dataLen = 23 - readIndex/8;
LOGPC(DRLCMACDATA, LOGL_NOTICE, "DATA[%u] = ", dataLen);
+ assert(dataLen <= 20);
for (unsigned i = 0; i < dataLen; i++)
{
data->RLC_DATA[i] = bitvec_read_field(vector, readIndex, 8);
@@ -5498,6 +5500,7 @@ void encode_gsm_rlcmac_downlink_data(bitvec * vector, RlcMacDownlinkDataBlock_t
}
unsigned dataNumOctets = 23 - writeIndex/8;
LOGPC(DRLCMACDATA, LOGL_NOTICE, "DATA[%u] = ", dataNumOctets);
+ assert(dataNumOctets <= 20);
for (unsigned i = 0; i < dataNumOctets; i++)
{
bitvec_write_field(vector, writeIndex, data->RLC_DATA[i], 8);