libnftables: set variable array to NULL after release
Pablo Neira Ayuso
maintainerPATCH 1/1 libnftables: set variable array to NULL after release
User reports that:
1. Call nft_ctx_clear_vars();
2. Call nft_ctx_free().
because nft_ctx_clear_vars() is called from nft_ctx_free().
results in double free, set ctx->vars to NULL from nft_ctx_clear_vars().
Fixes 4e8dff2cb4da ("src: expose nft_ctx_clear_vars as API")
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- src/libnftables.c | 1 + 1 file changed, 1 insertion(+)
src/libnftables.c +1 -0
@@ -160,6 +160,7 @@ void nft_ctx_clear_vars(struct nft_ctx *ctx) } ctx->num_vars =0 ;free (ctx->vars); + ctx->vars =NULL ; }EXPORT_SYMBOL (nft_ctx_add_include_path);
Signature · 1 line
2.30.2