diff --git a/drivers/net/ppp/ppp_synctty.c b/drivers/net/ppp/ppp_synctty.c index 644e99fc3..e537ea3d9 100644 --- a/drivers/net/ppp/ppp_synctty.c +++ b/drivers/net/ppp/ppp_synctty.c @@ -506,6 +506,12 @@ ppp_sync_txmunge(struct syncppp *ap, struct sk_buff *skb) unsigned char *data; int islcp; + /* Ensure skb is not NULL and has at least 3 bytes */ + if (!skb || skb->len < 3) { + kfree_skb(skb); + return NULL; + } + data = skb->data; proto = get_unaligned_be16(data);