pfctl: Do not allow whitespace in macro names
i.e. "this is" = "a variable" is not valid. It was accepted by the parser, but the variable could not be used afterwards. Obtained from: OpenBSD
This commit is contained in:
parent
71f8908a1a
commit
d3f6532494
@ -758,8 +758,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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user