]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
xtables-compat: also check tg2->userspacesize
authorFlorian Westphal <fw@strlen.de>
Sat, 5 May 2018 17:52:55 +0000 (19:52 +0200)
committerFlorian Westphal <fw@strlen.de>
Sat, 5 May 2018 18:02:53 +0000 (20:02 +0200)
memcmp uses tg1->userspacesize, make sure its same as tg2 first.

Signed-off-by: Florian Westphal <fw@strlen.de>
iptables/nft-shared.c

index 740b61bb6532e7f732c8659bc521218cc23240a5..fcc33d28104fb2b94356c1b5037c16d1bc800089 100644 (file)
@@ -848,7 +848,9 @@ bool compare_targets(struct xtables_target *tg1, struct xtables_target *tg2)
        if (tg1 == NULL && tg2 == NULL)
                return true;
 
-       if ((tg1 == NULL && tg2 != NULL) || (tg1 != NULL && tg2 == NULL))
+       if (tg1 == NULL || tg2 == NULL)
+               return false;
+       if (tg1->userspacesize != tg2->userspacesize)
                return false;
 
        if (strcmp(tg1->t->u.user.name, tg2->t->u.user.name) != 0)