summaryrefslogtreecommitdiffstats
path: root/net/x25/x25_dev.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2011-10-28 14:16:43 +0900
committerPaul Mundt <lethal@linux-sh.org>2011-10-28 14:16:43 +0900
commitd4d9781d1dd04ff134e3d43383dfa9991f7c54c6 (patch)
tree28e799ec49f72bf37f39d192d21f25bffb682aab /net/x25/x25_dev.c
parentf5a18f932e051ff0f19dcd80a421a4dd9b11f10f (diff)
parent396e6e49c58bb23d1814d3c240c736c9f01523c5 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into sh-latest
Diffstat (limited to 'net/x25/x25_dev.c')
-rw-r--r--net/x25/x25_dev.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/x25/x25_dev.c b/net/x25/x25_dev.c
index e547ca1578c..fa2b41888bd 100644
--- a/net/x25/x25_dev.c
+++ b/net/x25/x25_dev.c
@@ -32,6 +32,9 @@ static int x25_receive_data(struct sk_buff *skb, struct x25_neigh *nb)
unsigned short frametype;
unsigned int lci;
+ if (!pskb_may_pull(skb, X25_STD_MIN_LEN))
+ return 0;
+
frametype = skb->data[2];
lci = ((skb->data[0] << 8) & 0xF00) + ((skb->data[1] << 0) & 0x0FF);
@@ -115,6 +118,9 @@ int x25_lapb_receive_frame(struct sk_buff *skb, struct net_device *dev,
goto drop;
}
+ if (!pskb_may_pull(skb, 1))
+ return 0;
+
switch (skb->data[0]) {
case X25_IFACE_DATA: