diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/icmp.c | 3 | ||||
-rw-r--r-- | net/ipv6/icmp.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index a7321a82df6d..a13c074dac09 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c | |||
@@ -1015,7 +1015,8 @@ int icmp_rcv(struct sk_buff *skb) | |||
1015 | goto error; | 1015 | goto error; |
1016 | } | 1016 | } |
1017 | 1017 | ||
1018 | __skb_pull(skb, sizeof(*icmph)); | 1018 | if (!pskb_pull(skb, sizeof(*icmph))) |
1019 | goto error; | ||
1019 | 1020 | ||
1020 | icmph = icmp_hdr(skb); | 1021 | icmph = icmp_hdr(skb); |
1021 | 1022 | ||
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index cbb5b9cf84ad..121d517bf91c 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c | |||
@@ -683,7 +683,8 @@ static int icmpv6_rcv(struct sk_buff *skb) | |||
683 | } | 683 | } |
684 | } | 684 | } |
685 | 685 | ||
686 | __skb_pull(skb, sizeof(*hdr)); | 686 | if (!pskb_pull(skb, sizeof(*hdr))) |
687 | goto discard_it; | ||
687 | 688 | ||
688 | hdr = icmp6_hdr(skb); | 689 | hdr = icmp6_hdr(skb); |
689 | 690 | ||