aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-10-08 00:12:59 +0600
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-10-08 00:14:37 +0600
commit0fc23b9d2fbe028bce597d47211aea00c5d885e9 (patch)
treeaecdfde5326dd56ac57c0c90f96bc8126d8275ed
parent74c15a8c8a00756a522737c101b33d6cc9d4d12e (diff)
rsl_rx_resource_indication(): check result of rsl_tlv_parse()
-rw-r--r--src/osmo-bsc/abis_rsl.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 1d71c8330..0e2ffc698 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -1514,9 +1514,7 @@ static int rsl_rx_resource_indication(struct msgb *msg)
struct gsm_bts_trx *trx = sign_link->trx;
struct gsm_lchan *lchan;
int ts_nr;
- int i;
-
- rsl_tlv_parse(&tp, rslh->data, msgb_l2len(msg) - sizeof(*rslh));
+ int rc, i;
LOGP(DRSL, LOGL_DEBUG, "%s Rx Resource Indication\n", gsm_trx_name(trx));
@@ -1530,6 +1528,12 @@ static int rsl_rx_resource_indication(struct msgb *msg)
}
}
+ rc = rsl_tlv_parse(&tp, rslh->data, msgb_l2len(msg) - sizeof(*rslh));
+ if (rc < 0) {
+ LOGP(DRSL, LOGL_ERROR, "Rx Resource Indication: failed to parse the message\n");
+ return -EINVAL;
+ }
+
res_info_ie = TLVP_GET(&tp, RSL_IE_RESOURCE_INFO);
if (!res_info_ie) {
LOGP(DRSL, LOGL_ERROR, "Rx Resource Indication: missing Resource Info IE\n");