Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[NETFILTER]: arp_tables: fix NULL pointer dereference

The check is wrong and lets NULL-ptrs slip through since !IS_ERR(NULL)
is true.

Coverity #190

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Patrick McHardy and committed by
David S. Miller
31fe4d33 baa829d8

+1 -1
+1 -1
net/ipv4/netfilter/arp_tables.c
··· 771 771 struct arpt_table *t; 772 772 773 773 t = xt_find_table_lock(NF_ARP, entries->name); 774 - if (t || !IS_ERR(t)) { 774 + if (t && !IS_ERR(t)) { 775 775 struct xt_table_info *private = t->private; 776 776 duprintf("t->private->number = %u\n", 777 777 private->number);