checkpolicy: return YYerror on invalid character
Inform bison about an invalid character by returning YYerror, so the parser can cleanup internal state and return the failure via yyparse(). Currently the error is only observable via the global variable policydb_errors, which needs to be checked separately. Reported-by: oss-fuzz (issue #67270) Signed-off-by: Christian Göttsche <cgzones@googlemail.com> Acked-by: James Carter <jwcart2@gmail.com>
This commit is contained in:
parent
0e1e30db35
commit
f4330d5770
|
@ -308,7 +308,7 @@ GLBLUB { return(GLBLUB); }
|
||||||
"]" |
|
"]" |
|
||||||
"~" |
|
"~" |
|
||||||
"*" { return(yytext[0]); }
|
"*" { return(yytext[0]); }
|
||||||
. { yyerror("unrecognized character");}
|
. { yyerror("unrecognized character"); return YYerror; }
|
||||||
%%
|
%%
|
||||||
int yyerror(const char *msg)
|
int yyerror(const char *msg)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue