From e81377974336cad22e721e55e142749182877065 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 24 Jan 2001 01:32:51 +0000 Subject: fix another iptables-save segfault when match doesn't provide save function (bug detected by Emmanuel Roger, fix by HW) --- iptables-save.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'iptables-save.c') diff --git a/iptables-save.c b/iptables-save.c index 8795cb17..61ad4c9c 100644 --- a/iptables-save.c +++ b/iptables-save.c @@ -108,7 +108,10 @@ static int print_match(const struct ipt_entry_match *e, if (match) { printf("-m %s ", e->u.user.name); - match->save(ip, e); + + /* some matches don't provide a save function */ + if (match->save) + match->save(ip, e); } else { if (e->u.match_size) { fprintf(stderr, -- cgit v1.2.3