summaryrefslogtreecommitdiffstats
path: root/iptables-restore.c
diff options
context:
space:
mode:
Diffstat (limited to 'iptables-restore.c')
-rw-r--r--iptables-restore.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/iptables-restore.c b/iptables-restore.c
index 86d63e28..4a74485c 100644
--- a/iptables-restore.c
+++ b/iptables-restore.c
@@ -259,6 +259,12 @@ main(int argc, char *argv[])
exit(1);
}
+ if (strlen(chain) > XT_FUNCTION_MAXNAMELEN - 1)
+ xtables_error(PARAMETER_PROBLEM,
+ "Invalid chain name `%s' "
+ "(%u chars max)",
+ chain, XT_FUNCTION_MAXNAMELEN - 1);
+
if (iptc_builtin(chain, handle) <= 0) {
if (noflush && iptc_is_chain(chain, handle)) {
DEBUGP("Flushing existing user defined chain '%s'\n", chain);