]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
arptables: Fix incorrect strcmp() in nft_arp_rule_find()
authorPhil Sutter <phil@nwl.cc>
Wed, 19 Sep 2018 13:17:07 +0000 (15:17 +0200)
committerFlorian Westphal <fw@strlen.de>
Mon, 24 Sep 2018 09:50:01 +0000 (11:50 +0200)
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>
iptables/nft-arp.c

index b8e8982653bb3511e16a60e6d9ea73d92dbde519..a2109c608670de5641a4fbd17d8a2705e475096d 100644 (file)
@@ -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;