diff options
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-12-28 14:10:14 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2016-02-01 13:58:13 +0100
commit580edbc326268f0c3f4d0cbffeac963d06ffe8ac (patch)
parent8e323b39f99b7dd1be6ecd335c0620546ca0bfd8 (diff)
sched: Assert that the generated message is not empty
Currently the msg data is accessed and index 0 assuming the msg is not empty. While this should be always the case, the msg can be empty if there are software errors in the message creation functions. This commit adds an assertion to catch this kind of bugs. Sponsored-by: On-Waves ehf
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp
index b4db88c..8bf2573 100644
--- a/src/gprs_rlcmac_sched.cpp
+++ b/src/gprs_rlcmac_sched.cpp
@@ -330,6 +330,7 @@ int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_bts *bts,
/* msg is now available */
/* set USF */
+ OSMO_ASSERT(msgb_length(msg) > 0);
msg->data[0] = (msg->data[0] & 0xf8) | usf;
/* Used to measure the leak rate, count all blocks */