summaryrefslogtreecommitdiffstats
path: root/freebsd/sbin/pfctl/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/sbin/pfctl/parse.y')
-rw-r--r--freebsd/sbin/pfctl/parse.y8
1 files changed, 8 insertions, 0 deletions
diff --git a/freebsd/sbin/pfctl/parse.y b/freebsd/sbin/pfctl/parse.y
index adb6e1c9..8b6808a6 100644
--- a/freebsd/sbin/pfctl/parse.y
+++ b/freebsd/sbin/pfctl/parse.y
@@ -776,8 +776,16 @@ numberstring : NUMBER {
;
varset : STRING '=' varstring {
+ char *s = $1;
if (pf->opts & PF_OPT_VERBOSE)
printf("%s = \"%s\"\n", $1, $3);
+ while (*s++) {
+ if (isspace((unsigned char)*s)) {
+ yyerror("macro name cannot contain "
+ "whitespace");
+ YYERROR;
+ }
+ }
if (symset($1, $3, 0) == -1)
err(1, "cannot store variable %s", $1);
free($1);