summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org </C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org>2006-02-09 14:35:38 +0000
committer/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org </C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org>2006-02-09 14:35:38 +0000
commitb0789bd174418104b381da1720703f22d809ce9c (patch)
tree8f7b19f1a6ba840fcd63c8678f6b971d51a8228d
parent5cd6baed0d01d5ab6ae8ea72a189a327d20b9101 (diff)
fix segfault or loading of invalid counters in ip[6]tables-restore (Olaf Rempel) (Closes: #437)
-rw-r--r--ip6tables-restore.c5
-rw-r--r--iptables-restore.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/ip6tables-restore.c b/ip6tables-restore.c
index cf69a6c..f7eac68 100644
--- a/ip6tables-restore.c
+++ b/ip6tables-restore.c
@@ -266,7 +266,10 @@ int main(int argc, char *argv[])
char *ctrs;
ctrs = strtok(NULL, " \t\n");
- parse_counters(ctrs, &count);
+ if (!ctrs || !parse_counters(ctrs, &count))
+ exit_error(PARAMETER_PROBLEM,
+ "invalid policy counters "
+ "for chain '%s'\n", chain);
} else {
memset(&count, 0,
diff --git a/iptables-restore.c b/iptables-restore.c
index e2872cd..cc49c73 100644
--- a/iptables-restore.c
+++ b/iptables-restore.c
@@ -269,7 +269,10 @@ main(int argc, char *argv[])
char *ctrs;
ctrs = strtok(NULL, " \t\n");
- parse_counters(ctrs, &count);
+ if (!ctrs || !parse_counters(ctrs, &count))
+ exit_error(PARAMETER_PROBLEM,
+ "invalid policy counters "
+ "for chain '%s'\n", chain);
} else {
memset(&count, 0,