From c51b85f995caebd41e6d063c8bcab513b305bcaa Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sun, 27 Jan 2013 23:19:49 +0100 Subject: nft: fix crash if TRACE is used And any other match and target with no save function defined. Signed-off-by: Pablo Neira Ayuso --- iptables/nft.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'iptables') diff --git a/iptables/nft.c b/iptables/nft.c index c3d5d610..445d8f92 100644 --- a/iptables/nft.c +++ b/iptables/nft.c @@ -1006,7 +1006,8 @@ static void nft_match_save(struct nft_rule_expr *expr) printf("-m %s", match->name); /* FIXME missing parameter */ - match->save(NULL, emu); + if (match->save) + match->save(NULL, emu); printf(" "); @@ -1049,7 +1050,8 @@ static void nft_target_save(struct nft_rule_expr *expr) printf("-j %s", target->name); /* FIXME missing parameter */ - target->save(NULL, emu); + if (target->save) + target->save(NULL, emu); free(emu); } -- cgit v1.2.3