From: Phil Oester <kernel@linuxace.com>
To: netfilter-devel@lists.netfilter.org
Subject: [PATCH] ip6tables: check for valid init prior to calling
Date: Sun, 3 Jul 2005 10:03:45 -0700 [thread overview]
Message-ID: <20050703170345.GA20892@linuxace.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 260 bytes --]
Unlike iptables, ip6tables does not check that match|target->init
is !NULL prior to calling, leading to problems in those extensions
which don't define init, like owner:
# ip6tables -m owner
Segmentation fault
The below patch copies iptables checks.
Phil
[-- Attachment #2: patch-ip6tinit --]
[-- Type: text/plain, Size: 1406 bytes --]
diff -ruN ipt-orig/ip6tables.c ipt-new/ip6tables.c
--- ipt-orig/ip6tables.c 2005-02-19 11:19:17.000000000 -0800
+++ ipt-new/ip6tables.c 2005-07-03 09:57:48.000000000 -0700
@@ -1919,7 +1919,8 @@
target->t = fw_calloc(1, size);
target->t->u.target_size = size;
strcpy(target->t->u.user.name, jumpto);
- target->init(target->t, &fw.nfcache);
+ if (target->init != NULL)
+ target->init(target->t, &fw.nfcache);
opts = merge_options(opts, target->extra_opts, &target->option_offset);
}
break;
@@ -1963,7 +1964,8 @@
m->m = fw_calloc(1, size);
m->m->u.match_size = size;
strcpy(m->m->u.user.name, m->name);
- m->init(m->m, &fw.nfcache);
+ if (m->init != NULL)
+ m->init(m->m, &fw.nfcache);
opts = merge_options(opts, m->extra_opts, &m->option_offset);
}
break;
@@ -2104,7 +2106,8 @@
m->m = fw_calloc(1, size);
m->m->u.match_size = size;
strcpy(m->m->u.user.name, m->name);
- m->init(m->m, &fw.nfcache);
+ if (m->init != NULL)
+ m->init(m->m, &fw.nfcache);
opts = merge_options(opts,
m->extra_opts, &m->option_offset);
@@ -2232,7 +2235,8 @@
target->t = fw_calloc(1, size);
target->t->u.target_size = size;
strcpy(target->t->u.user.name, jumpto);
- target->init(target->t, &fw.nfcache);
+ if (target->init != NULL)
+ target->init(target->t, &fw.nfcache);
}
if (!target) {
next reply other threads:[~2005-07-03 17:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-03 17:03 Phil Oester [this message]
2005-07-04 4:54 ` [PATCH] ip6tables: check for valid init prior to calling Jonas Berlin
2005-07-04 8:44 ` Harald Welte
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=20050703170345.GA20892@linuxace.com \
--to=kernel@linuxace.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.