提交 58618115 编写于 作者: D Dan Carpenter 提交者: Pablo Neira Ayuso

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: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NHans Schillstrom <hans.schillstrom@ericsson.com>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
上级 1f27e251
......@@ -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? */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册