aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs/gprs_llc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gprs/gprs_llc.c')
-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 abbb7427..41feeca5 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);