From: Florian Westphal Date: Sat, 5 May 2018 17:52:55 +0000 (+0200) Subject: xtables-compat: also check tg2->userspacesize X-Git-Tag: v1.8.0~79 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c7b2fd6f8ee50c0f3be02102fe47b50c65e9e57a;p=thirdparty%2Fiptables.git xtables-compat: also check tg2->userspacesize memcmp uses tg1->userspacesize, make sure its same as tg2 first. Signed-off-by: Florian Westphal --- 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)