summaryrefslogtreecommitdiffstats
path: root/extensions/libipt_LOG.c
diff options
context:
space:
mode:
authorPhil Oester <kernel@linuxace.com>2005-04-01 07:07:00 +0000
committerHarald Welte <laforge@gnumonks.org>2005-04-01 07:07:00 +0000
commit182f3f62acbcb88b615b3d7d5940e316472be049 (patch)
tree914ee4b05f2a9d60b24b18ade16f43dc26746551 /extensions/libipt_LOG.c
parent1b91e59339cf782a390329c4f664e3d441eaec6e (diff)
don't allow newlines in LOG prefix (Phil Oester) (Closes: #312)
Diffstat (limited to 'extensions/libipt_LOG.c')
-rw-r--r--extensions/libipt_LOG.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/extensions/libipt_LOG.c b/extensions/libipt_LOG.c
index 74d65552..5e5d3fd8 100644
--- a/extensions/libipt_LOG.c
+++ b/extensions/libipt_LOG.c
@@ -143,6 +143,10 @@ parse(int c, char **argv, int invert, unsigned int *flags,
"Maximum prefix length %u for --log-prefix",
(unsigned int)sizeof(loginfo->prefix) - 1);
+ if (strlen(optarg) != strlen(strtok(optarg, "\n")))
+ exit_error(PARAMETER_PROBLEM,
+ "Newlines not allowed in --log-prefix");
+
strcpy(loginfo->prefix, optarg);
*flags |= IPT_LOG_OPT_PREFIX;
break;