]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
[Fwd: Re: more iproute2 issues (not critical)]
authorPatrick McHardy <kaber@trash.net>
Tue, 19 Jun 2007 23:37:53 +0000 (01:37 +0200)
committerStephen Hemminger <shemminger@linux-foundation.org>
Wed, 20 Jun 2007 17:52:22 +0000 (10:52 -0700)
This one also makes sense for the release I guess.

-------- Original Message --------
Subject:  Re: more iproute2 issues (not critical)
Date:  Sat, 31 Mar 2007 16:16:56 +0200
From:  Patrick McHardy <kaber@trash.net>
To:  Denys <denys@visp.net.lb>
CC: Stephen Hemminger <shemminger@linux-foundation.org>,
netdev@vger.kernel.org
References:  <20070321175951.M73913@visp.net.lb>
<46026717.9060909@trash.net> <20070322124533.M79867@visp.net.lb>
<46027FF2.6020001@trash.net> <20070322101224.3e6bb899@freekitty>
<20070331021401.M17326@visp.net.lb> <20070331023011.M8101@visp.net.lb>

Denys wrote:
> Ooops, sorry, it seems my fault, no library exist on this system.
> But i guess it must not coredump in this case? Is it possible to check if
> library not exist and just print some nice message?
> It is trivial i guess.

The problem is that lib_dir is NULL when calling get_target_names.
This patch fixes it.

[IPROUTE]: m_ipt: fix crash when dumping rules

lib_dir is NULL when calling get_target_name, causing a NULL pointer
dereference in the strlen call.

Signed-off-by: Patrick McHardy <kaber@trash.net>
tc/m_ipt.c

index 38d2311ab1cdd97d41547ea84b3067d73b6239a3..76fa768edaadcf5848222e5ccdd80c885817d473 100644 (file)
@@ -506,6 +506,10 @@ print_ipt(struct action_util *au,FILE * f, struct rtattr *arg)
        if (arg == NULL)
                return -1;
 
+       lib_dir = getenv("IPTABLES_LIB_DIR");
+       if (!lib_dir)
+               lib_dir = IPT_LIB_DIR;
+
        parse_rtattr_nested(tb, TCA_IPT_MAX, arg);
 
        if (tb[TCA_IPT_TABLE] == NULL) {