All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: "Laurence J. Lane" <ljlane@nontoxic.org>
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: #263154: iptables: segfault with multiple ip hostnames
Date: Wed, 04 Aug 2004 00:26:22 +0200	[thread overview]
Message-ID: <4110110E.40904@trash.net> (raw)
In-Reply-To: <20040803220350.GA5223@ljlane.net>

Laurence J. Lane wrote:

>http://bugs.debian.org/263154
>
>iptables 1.2.11 segfaults when given a domain name that resolves 
>to multiple ip addresses. The situation is the same for kernel 
>versions 2.4.26 and 2.6.7.
>
>As an example:
>
>  # iptables -I INPUT -s google.com -j DROP
>  free(): invalid pointer 0x8055a4c!
>  Segmentation fault
>  
>
Already fixed in CVS:

http://cvs.netfilter.org/iptables/iptables.c?r1=1.68&r2=1.69

But seems to be missing this:

diff -u -r1.69 iptables.c
--- iptables.c  4 Jul 2004 15:20:53 -0000       1.69
+++ iptables.c  3 Aug 2004 22:22:25 -0000
@@ -551,7 +551,7 @@
                                                                                                                              

                while (host->h_addr_list[*naddr] != (char *) NULL)
                        (*naddr)++;
-               addr = fw_calloc(*naddr, sizeof(struct in_addr));
+               addr = fw_calloc(*naddr, sizeof(struct in_addr) * *naddr);
                for (i = 0; i < *naddr; i++)
                        inaddrcpy(&(addr[i]),
                                  (struct in_addr *) host->h_addr_list[i]);

Regards
Patrick

  parent reply	other threads:[~2004-08-03 22:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-03 22:03 #263154: iptables: segfault with multiple ip hostnames Laurence J. Lane
2004-08-03 22:11 ` Phil Oester
2004-08-03 22:26 ` Patrick McHardy [this message]
2004-08-20 16:09   ` Herve Eychenne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4110110E.40904@trash.net \
    --to=kaber@trash.net \
    --cc=ljlane@nontoxic.org \
    --cc=netfilter-devel@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.