diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2011-09-05 20:15:10 +0200 |
---|---|---|
committer | Jan Engelhardt <jengelh@medozas.de> | 2011-09-05 20:16:07 +0200 |
commit | bf42cf92ea0c53e5470a20d62d00e5e83379f4d5 (patch) | |
tree | 7cba1e34606eb3ae97a23c9f60e524d2ae6f9fb2 /iptables | |
parent | 5df067f91b8ffa7801d09e6dd13fe9bf4b7b490b (diff) | |
parent | 2ca6273c73b42e8c74afd5f8b1fe10c5c93ce363 (diff) |
Merge branch 'stable' of git://dev.medozas.de/iptables
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'iptables')
-rw-r--r-- | iptables/xtables.c | 4 | ||||
-rw-r--r-- | iptables/xtoptions.c | 6 |
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); |