aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-06-21 02:37:42 +0200
committerfixeria <vyanitskiy@sysmocom.de>2021-06-23 11:44:43 +0000
commite87f20f621a9c7dbe677da42264a75c31397cbf1 (patch)
treed4373783d68bd3a56aa2d6eb53410006992a97bb
parentd5db754514017c4f793abb78791f72199d1f8ee6 (diff)
abis_rsl: fix rsl_rx_ccch_load(): properly check the message length
msg->data_len is the total number of bytes available in the buffer, not the actual length of the payload. Use msgb_length(). Change-Id: I35bf0827ff14e84a755c1aa24a6efc06bc7b9f9b
-rw-r--r--src/osmo-bsc/abis_rsl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 86b179067..0d921413a 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -1987,7 +1987,7 @@ static int rsl_rx_ccch_load(struct msgb *msg)
osmo_signal_dispatch(SS_CCCH, S_CCCH_PAGING_LOAD, &sd);
break;
case RSL_IE_RACH_LOAD:
- if (msg->data_len >= 7) {
+ if (msgb_length(msg) >= 7) {
int32_t busy_percent, access_percent;
/* build data for signal */
sd.rach_slot_count = rslh->data[2] << 8 | rslh->data[3];