37 lines
1.2 KiB
Diff
37 lines
1.2 KiB
Diff
From f4330d57705205b52ec117803bf8543a2e59bb00 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com>
|
|
Date: Mon, 11 Mar 2024 15:57:04 +0100
|
|
Subject: [PATCH] checkpolicy: return YYerror on invalid character
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
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>
|
|
---
|
|
policy_scan.l | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/policy_scan.l b/policy_scan.l
|
|
index 19c05a58..1926129c 100644
|
|
--- a/policy_scan.l
|
|
+++ b/policy_scan.l
|
|
@@ -310,7 +310,7 @@ GLBLUB { return(GLBLUB); }
|
|
"]" |
|
|
"~" |
|
|
"*" { return(yytext[0]); }
|
|
-. { yyerror("unrecognized character");}
|
|
+. { yyerror("unrecognized character"); return YYerror; }
|
|
%%
|
|
int yyerror(const char *msg)
|
|
{
|
|
--
|
|
2.33.0
|
|
|