summaryrefslogtreecommitdiffstats
path: root/iptables
diff options
context:
space:
mode:
Diffstat (limited to 'iptables')
-rw-r--r--iptables/xtables.c4
-rw-r--r--iptables/xtoptions.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/iptables/xtables.c b/iptables/xtables.c
index 233efa30..e72aa284 100644
--- a/iptables/xtables.c
+++ b/iptables/xtables.c
@@ -515,15 +515,13 @@ void xtables_parse_interface(const char *arg, char *vianame,
strcpy(vianame, arg);
if (vialen == 0)
- memset(mask, 0, IFNAMSIZ);
+ return;
else if (vianame[vialen - 1] == '+') {
memset(mask, 0xFF, vialen - 1);
- memset(mask + vialen - 1, 0, IFNAMSIZ - vialen + 1);
/* Don't remove `+' here! -HW */
} else {
/* Include nul-terminator in match */
memset(mask, 0xFF, vialen + 1);
- memset(mask + vialen + 1, 0, IFNAMSIZ - vialen - 1);
for (i = 0; vianame[i]; i++) {
if (vianame[i] == '/' ||
vianame[i] == ' ') {
diff --git a/iptables/xtoptions.c b/iptables/xtoptions.c
index 04344af4..5f617a42 100644
--- a/iptables/xtoptions.c
+++ b/iptables/xtoptions.c
@@ -826,6 +826,12 @@ void xtables_option_parse(struct xt_option_call *cb)
xt_params->exit_err(PARAMETER_PROBLEM,
"%s: option \"--%s\" requires an argument.\n",
cb->ext_name, entry->name);
+ /*
+ * Fill in fallback value for "nvals", in case an extension (as it
+ * happened with libxt_conntrack.2) tries to read it, despite not using
+ * a *RC option type.
+ */
+ cb->nvals = 1;
if (entry->type <= ARRAY_SIZE(xtopt_subparse) &&
xtopt_subparse[entry->type] != NULL)
xtopt_subparse[entry->type](cb);