From: Florian Westphal Date: Tue, 14 Mar 2023 21:36:50 +0000 (+0100) Subject: xtables-eb: fix crash when opts isn't reallocated X-Git-Tag: v1.8.10~72 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e900d40afdb731d2270a5110833ae49192974355;p=thirdparty%2Fiptables.git xtables-eb: fix crash when opts isn't reallocated opts may point to statically allocated memory. This fixes abort() from libc. Signed-off-by: Florian Westphal --- diff --git a/iptables/xtables-eb.c b/iptables/xtables-eb.c index 3a73e797..068dffd2 100644 --- a/iptables/xtables-eb.c +++ b/iptables/xtables-eb.c @@ -675,7 +675,8 @@ void nft_fini_eb(struct nft_handle *h) free(target->t); } - free(opts); + if (opts != ebt_original_options) + free(opts); nft_fini(h); xtables_fini();