fixeria submitted this change.
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(-)
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 change 29650. To unsubscribe, or for help writing mail filters, visit settings.