From c7b2fd6f8ee50c0f3be02102fe47b50c65e9e57a Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Sat, 5 May 2018 19:52:55 +0200 Subject: xtables-compat: also check tg2->userspacesize memcmp uses tg1->userspacesize, make sure its same as tg2 first. Signed-off-by: Florian Westphal --- iptables/nft-shared.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'iptables/nft-shared.c') 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) -- cgit v1.2.3