netfilter: xt_HMARK: potential NULL dereference in get_inner_hdr()

There is a typo in the error checking and "&&" was used instead of "||".
If skb_header_pointer() returns NULL then it leads to a NULL
dereference.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
Dan Carpenter 2012-05-12 01:00:03 +00:00 committed by Pablo Neira Ayuso
parent 1f27e2516c
commit 5861811549

View file

@ -223,7 +223,7 @@ static int get_inner_hdr(const struct sk_buff *skb, int iphsz, int *nhoff)
/* Not enough header? */
icmph = skb_header_pointer(skb, *nhoff + iphsz, sizeof(_ih), &_ih);
if (icmph == NULL && icmph->type > NR_ICMP_TYPES)
if (icmph == NULL || icmph->type > NR_ICMP_TYPES)
return 0;
/* Error message? */