summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Piotr Oledzki <ole@ans.pl>2005-11-09 22:04:08 +0100
committerDavid S. Miller <davem@davemloft.net>2005-11-09 22:04:08 +0100
commit439a9994bb6ae3c7cab1f0b776bca6bc7aa58a11 (patch)
treef4d99b79ea24ec2b9c65165d0c4528058cee1f35
parent[NETFILTER] ctnetlink: Add support to identify expectations by ID's (diff)
downloadlinux-439a9994bb6ae3c7cab1f0b776bca6bc7aa58a11.tar.xz
linux-439a9994bb6ae3c7cab1f0b776bca6bc7aa58a11.zip
[NETFILTER] ctnetlink: Fix oops when no ICMP ID info in message
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>
-rw-r--r--net/ipv4/netfilter/ip_conntrack_proto_icmp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_icmp.c b/net/ipv4/netfilter/ip_conntrack_proto_icmp.c
index 9481d159acb6..083951e20690 100644
--- a/net/ipv4/netfilter/ip_conntrack_proto_icmp.c
+++ b/net/ipv4/netfilter/ip_conntrack_proto_icmp.c
@@ -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 =