Skip to content

Commit

Permalink
[NETFILTER] ctnetlink: Fix oops when no ICMP ID info in message
Browse files Browse the repository at this point in the history
This patch fixes an userspace triggered oops. If there is no ICMP_ID
info the reference to attr will be NULL.

Signed-off-by: Krzysztof Piotr Oledzki <ole@ans.pl>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Krzysztof Piotr Oledzki authored and David S. Miller committed Nov 9, 2005
1 parent a856a19 commit 439a999
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/ipv4/netfilter/ip_conntrack_proto_icmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ static int icmp_nfattr_to_tuple(struct nfattr *tb[],
struct ip_conntrack_tuple *tuple)
{
if (!tb[CTA_PROTO_ICMP_TYPE-1]
|| !tb[CTA_PROTO_ICMP_CODE-1])
|| !tb[CTA_PROTO_ICMP_CODE-1]
|| !tb[CTA_PROTO_ICMP_ID-1])
return -1;

tuple->dst.u.icmp.type =
Expand Down

0 comments on commit 439a999

Please sign in to comment.