From: Harald Welte Date: Wed, 24 Jan 2001 01:32:51 +0000 (+0000) Subject: fix another iptables-save segfault when match doesn't provide save function (bug... X-Git-Tag: v1.2.1~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e81377974336cad22e721e55e142749182877065;p=thirdparty%2Fiptables.git fix another iptables-save segfault when match doesn't provide save function (bug detected by Emmanuel Roger, fix by HW) --- 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,