diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-05-12 01:00:03 (GMT) |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-05-16 22:56:33 (GMT) |
commit | 58618115492711d99fbccb79c5317299e32231fe (patch) | |
tree | 6fd9fe61601aee724c16d2e5d26d5219e54fc042 /net/netfilter/xt_HMARK.c | |
parent | 1f27e2516c1d95ae19024bec5be68a3f489cc47e (diff) | |
download | linux-58618115492711d99fbccb79c5317299e32231fe.tar.xz |
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>
Diffstat (limited to 'net/netfilter/xt_HMARK.c')
-rw-r--r-- | net/netfilter/xt_HMARK.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/xt_HMARK.c b/net/netfilter/xt_HMARK.c index 32fbd73..5817d03 100644 --- a/net/netfilter/xt_HMARK.c +++ b/net/netfilter/xt_HMARK.c @@ -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? */ |