From: Thomas Woerner <twoerner@redhat.com>
To: netfilter-devel@lists.netfilter.org
Subject: [PATCH] segmentation fault in free
Date: Thu, 26 Aug 2004 15:36:56 +0200 [thread overview]
Message-ID: <412DE778.2030202@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 636 bytes --]
Hello,
I have found a bad bug in iptables. saddrs and daddrs are allocated with calloc in
host_to_addr if a hostname resolves to more than one ip address, but each array
element if getting freed in do_command. The first free will free the whole array and
the others are returning that this is not a pointer or are segfaulting.
Fix for this is attached.
Thanks,
Thomas
--
Thomas Woerner
Software Engineer Phone: +49-711-96437-310
Red Hat GmbH Fax : +49-711-96437-111
Hauptstaetterstr. 58 Email: Thomas Woerner <twoerner@redhat.com>
D-70178 Stuttgart Web : http://www.redhat.de/
[-- Attachment #2: iptables-1.2.11-free.patch --]
[-- Type: text/x-patch, Size: 369 bytes --]
--- iptables-1.2.11/iptables.c.free 2004-08-25 19:15:29.000000000 +0200
+++ iptables-1.2.11/iptables.c 2004-08-26 15:34:28.490605182 +0200
@@ -2344,11 +2344,8 @@
e = NULL;
}
- for (c = 0; c < nsaddrs; c++)
- free(&saddrs[c]);
-
- for (c = 0; c < ndaddrs; c++)
- free(&daddrs[c]);
+ free(saddrs);
+ free(daddrs);
if (opts != original_opts) {
free(opts);
next reply other threads:[~2004-08-26 13:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-26 13:36 Thomas Woerner [this message]
2004-08-26 16:14 ` [PATCH] segmentation fault in free Patrick McHardy
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=412DE778.2030202@redhat.com \
--to=twoerner@redhat.com \
--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.