diff options
author | Phil Sutter <phil@nwl.cc> | 2018-09-19 15:17:07 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2018-09-24 11:50:01 +0200 |
commit | 7c9a1521105aa515a272e2d04fa806bed8b43396 (patch) | |
tree | d635da4257ffa48eadfcceac17e628bc710c0347 | |
parent | 11e91a4875b443450dc08951efd6a595d3f5df2e (diff) |
arptables: Fix incorrect strcmp() in nft_arp_rule_find()
Since nft_arp_rule_to_cs() may not set cs->jumpto, later call to
strcmp() may be passed a NULL pointer. Therefore check if the pointer is
valid before doing so.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
-rw-r--r-- | iptables/nft-arp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/iptables/nft-arp.c b/iptables/nft-arp.c index b8e89826..a2109c60 100644 --- a/iptables/nft-arp.c +++ b/iptables/nft-arp.c @@ -661,7 +661,7 @@ static bool nft_arp_rule_find(struct nft_family_ops *ops, struct nftnl_rule *r, if (!compare_targets(cs->target, this.target)) return false; - if (strcmp(cs->jumpto, this.jumpto) != 0) + if (this.jumpto && strcmp(cs->jumpto, this.jumpto) != 0) return false; return true; |