Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 439a9994 authored by Krzysztof Piotr Oledzki's avatar Krzysztof Piotr Oledzki Committed by David S. Miller
Browse files

[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: default avatarKrzysztof Piotr Oledzki <ole@ans.pl>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarHarald Welte <laforge@netfilter.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a856a19a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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 =