diff options
author | Florian Westphal <fw@strlen.de> | 2018-05-05 19:52:55 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2018-05-05 20:02:53 +0200 |
commit | c7b2fd6f8ee50c0f3be02102fe47b50c65e9e57a (patch) | |
tree | e68d0320fd697d06412753aee565686f15d73b72 | |
parent | 56859380eb3282218863d827b7df822c7b0fd67c (diff) |
xtables-compat: also check tg2->userspacesize
memcmp uses tg1->userspacesize, make sure its same as tg2 first.
Signed-off-by: Florian Westphal <fw@strlen.de>
-rw-r--r-- | iptables/nft-shared.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/iptables/nft-shared.c b/iptables/nft-shared.c index 740b61bb..fcc33d28 100644 --- a/iptables/nft-shared.c +++ b/iptables/nft-shared.c @@ -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) |