From 59a5fce68ad9f61a803164d0fba18ca57eb6242e Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Sat, 26 Jul 2008 11:59:10 +0100 Subject: [PATCH] --- yaml --- r: 106668 b: refs/heads/master c: 18e1d836002ad970f42736bad09b7be9cfe99545 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/net/dccp/ipv4.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 7785cfeb8666..e2d62a410bea 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e0bcfb0c6a6ed9ebd68746b306298dc5797fd426 +refs/heads/master: 18e1d836002ad970f42736bad09b7be9cfe99545 diff --git a/trunk/net/dccp/ipv4.c b/trunk/net/dccp/ipv4.c index 6a2f1879e183..882c5c4de69e 100644 --- a/trunk/net/dccp/ipv4.c +++ b/trunk/net/dccp/ipv4.c @@ -196,8 +196,8 @@ static inline void dccp_do_pmtu_discovery(struct sock *sk, static void dccp_v4_err(struct sk_buff *skb, u32 info) { const struct iphdr *iph = (struct iphdr *)skb->data; - const struct dccp_hdr *dh = (struct dccp_hdr *)(skb->data + - (iph->ihl << 2)); + const u8 offset = iph->ihl << 2; + const struct dccp_hdr *dh = (struct dccp_hdr *)(skb->data + offset); struct dccp_sock *dp; struct inet_sock *inet; const int type = icmp_hdr(skb)->type; @@ -207,7 +207,8 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info) int err; struct net *net = dev_net(skb->dev); - if (skb->len < (iph->ihl << 2) + 8) { + if (skb->len < offset + sizeof(*dh) || + skb->len < offset + __dccp_basic_hdr_len(dh)) { ICMP_INC_STATS_BH(net, ICMP_MIB_INERRORS); return; }