[iptables PATCH 14/23] ebtables: Fix segfault when parsing a rule

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This should happen in ebtables-restore only: If a previous rule
contained a standard target, the standard target object is inserted into
xtables_targets. Though since that doesn't have a 'parse' callback, the
code segfaults. Therefore make the code ignore that special object
(which is not an issue since standard targets don't support parameters).

Signed-off-by: Phil Sutter <phil@xxxxxx>
---
 iptables/xtables-eb.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/iptables/xtables-eb.c b/iptables/xtables-eb.c
index 06ca5daa20541..c05adb92a7be2 100644
--- a/iptables/xtables-eb.c
+++ b/iptables/xtables-eb.c
@@ -1222,6 +1222,9 @@ print_zero:
 
 			/* Is it a watcher option? */
 			for (w = xtables_targets; w; w = w->next) {
+				if (!strcmp(w->name, "standard"))
+					continue;
+
 				if (w->parse(c - w->option_offset, argv,
 					     ebt_invert, &w->tflags,
 					     NULL, &w->t)) {
-- 
2.18.0

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux