]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
xtables-eb: fix crash when opts isn't reallocated
authorFlorian Westphal <fw@strlen.de>
Tue, 14 Mar 2023 21:36:50 +0000 (22:36 +0100)
committerFlorian Westphal <fw@strlen.de>
Tue, 14 Mar 2023 21:39:15 +0000 (22:39 +0100)
opts may point to statically allocated memory.
This fixes abort() from libc.

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

index 3a73e79725489252165919271dedd73c605de205..068dffd2310312c7f7c130f60245f8f8f09283fb 100644 (file)
@@ -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();