aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith <keith@rhizomatica.org>2019-04-23 13:23:17 +0100
committerKeith <keith@rhizomatica.org>2019-04-23 13:23:17 +0100
commit9665bf2b625c1201dde04a234d51e5ebd92b4c60 (patch)
treef1aa3c17428b52eadd0d2da693c4c0121aa2e7f6
parent932ccf87a0eede73514bf95d403efd5189dbe792 (diff)
Leave gprs_llc_rcvmsg earlykeith/prevent_MSGB_ABORT
to prevent crash when msgb->data is zero. Change-Id: I2da099d31c914224eea71323a6e6aeaec03662c0
-rw-r--r--src/gprs/gprs_llc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c
index abbb742..41feeca 100644
--- a/src/gprs/gprs_llc.c
+++ b/src/gprs/gprs_llc.c
@@ -946,6 +946,13 @@ int gprs_llc_rcvmsg(struct msgb *msg, struct tlv_parsed *tv)
return -EIO;
}
/* set l3 layer & remove the fcs */
+
+ /* We'll crash here sometimes because msg->data = 0 */
+ if (llhp.cmd == GPRS_LLC_NULL) {
+ LOGP(DLLC, LOGL_ERROR,
+ "Dropping llhp.cmd == GPRS_LLC_NULL (would have crashed.)\n");
+ return -EIO;
+ }
msg->l3h = llhp.data;
msgb_l3trim(msg, llhp.data_len);