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

Change subject: l1sap: do not call msgb_l2hlen without checking
......................................................................

l1sap: do not call msgb_l2hlen without checking

We request the length using msgb_l2len() in two locations where whe
cannot be sure that l2h is populated. Lets check this first.

Change-Id: Ie13d0724f183ff240714dcdbd24e5a21b4276bfe
Related: OS#5645
---
M src/common/l1sap.c
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 0598144..8bcd417 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -349,7 +349,7 @@
        uint8_t chan_nr, link_id;

        *data = msgb_l2(msg);
-       *len = msgb_l2len(msg);
+       *len = msgb_l2(msg) ? msgb_l2len(msg) : 0;
        chan_nr = l1sap->u.data.chan_nr;
        link_id = l1sap->u.data.link_id;

@@ -391,7 +391,7 @@
        struct msgb *msg = l1sap->oph.msg;

        *data = msgb_l2(msg);
-       *len = msgb_l2len(msg);
+       *len = msgb_l2(msg) ? msgb_l2len(msg) : 0;

        if (L1SAP_IS_PTCCH(fn)) {
                *chan_type = GSMTAP_CHANNEL_PTCCH;

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ie13d0724f183ff240714dcdbd24e5a21b4276bfe
Gerrit-Change-Number: 29650
Gerrit-PatchSet: 4
Gerrit-Owner: dexter <pma...@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanits...@sysmocom.de>
Gerrit-Reviewer: osmith <osm...@sysmocom.de>
Gerrit-Reviewer: pespin <pes...@sysmocom.de>
Gerrit-CC: laforge <lafo...@osmocom.org>
Gerrit-MessageType: merged

Reply via email to