From e7bbd67be69520443a6c62e81bd7d12a10d090b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Fri, 18 Oct 2024 17:12:13 +0200 Subject: [PATCH] checkpolicy/fuzz: fix setjmp condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit setjmp(3) returns 0 on the first fake invocation, adjust the condition accordingly. Reported by the OSS Fuzz Introspector[1]. [1]: https://storage.googleapis.com/oss-fuzz-introspector/selinux/inspector-report/20241016/fuzz_report.html Fixes: f07fc2a75 ("checkpolicy/fuzz: override YY_FATAL_ERROR") Signed-off-by: Christian Göttsche Acked-by: James Carter --- checkpolicy/fuzz/checkpolicy-fuzzer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checkpolicy/fuzz/checkpolicy-fuzzer.c b/checkpolicy/fuzz/checkpolicy-fuzzer.c index ddb43260..331201c0 100644 --- a/checkpolicy/fuzz/checkpolicy-fuzzer.c +++ b/checkpolicy/fuzz/checkpolicy-fuzzer.c @@ -101,7 +101,7 @@ static int read_source_policy(policydb_t *p, const uint8_t *data, size_t size) init_parser(1); - if (!setjmp(fuzzing_pre_parse_stack_state)) { + if (setjmp(fuzzing_pre_parse_stack_state) != 0) { queue_destroy(id_queue); fclose(yyin); yylex_destroy();