[PATCH] checkpolicy-fuzzer: drop invalid assertion

Stephen Smalley <[email protected]>
Newsgroups org.kernel.vger.selinux
Message-ID <[email protected]>
The checkpolicy-fuzzer has an invalid assertion; checkpolicy
intentionally tracks errors via policydb_errors and does not always
return non-zero from yyparse() if there were any errors during the
compilation.

Reported-by: oss-fuzz (issue 471491765)
Signed-off-by: Stephen Smalley <[email protected]>
---
 checkpolicy/fuzz/checkpolicy-fuzzer.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/checkpolicy/fuzz/checkpolicy-fuzzer.c b/checkpolicy/fuzz/checkpolicy-fuzzer.c
index c58d10e9..771b52f5 100644
--- a/checkpolicy/fuzz/checkpolicy-fuzzer.c
+++ b/checkpolicy/fuzz/checkpolicy-fuzzer.c
@@ -106,8 +106,6 @@ static int read_source_policy(policydb_t *p, const uint8_t *data, size_t size)
 	}
 
 	rc = yyparse();
-	// TODO: drop global variable policydb_errors if proven to be redundant
-	assert(rc || !policydb_errors);
 	if (rc || policydb_errors) {
 		queue_destroy(id_queue);
 		fclose(yyin);
-- 
2.55.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.