Change in osmo-bsc[master]: rsl_rx_resource_indication(): check result of rsl_tlv_parse()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

fixeria gerrit-no-reply at lists.osmocom.org
Fri Oct 8 16:17:00 UTC 2021


fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/25719 )

Change subject: rsl_rx_resource_indication(): check result of rsl_tlv_parse()
......................................................................

rsl_rx_resource_indication(): check result of rsl_tlv_parse()

Change-Id: I3b4758f80f2cd87e22bd3617e189f12403461ea3
Related: SYS#5313
---
M src/osmo-bsc/abis_rsl.c
1 file changed, 7 insertions(+), 3 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved



diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 1d71c83..0e2ffc6 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -1514,9 +1514,7 @@
 	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 @@
 		}
 	}
 
+	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");

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25719
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I3b4758f80f2cd87e22bd3617e189f12403461ea3
Gerrit-Change-Number: 25719
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211008/b8dcec3b/attachment.htm>


More information about the gerrit-log mailing list