From d11ac929af64ce0183d3d80101c04da9b78262c8 Mon Sep 17 00:00:00 2001 From: Arne Welzel Date: Wed, 29 Nov 2023 19:38:19 +0100 Subject: [PATCH] zeek-setup: Exit when rule loading tickles reporter errors With custom events for signatures, Reporter::error() may be invoked while loading them. Early exit in case that happens. We could continue and either disable the signatures or fallback to the default signature_match() event, but not sure that would be obviously better. --- src/zeek-setup.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zeek-setup.cc b/src/zeek-setup.cc index afe5cec284..a3463520f9 100644 --- a/src/zeek-setup.cc +++ b/src/zeek-setup.cc @@ -891,7 +891,7 @@ SetupResult setup(int argc, char** argv, Options* zopts) { if ( ! all_signature_files.empty() ) { rule_matcher = new RuleMatcher(options.signature_re_level); - if ( ! rule_matcher->ReadFiles(all_signature_files) ) { + if ( ! rule_matcher->ReadFiles(all_signature_files) || zeek::reporter->Errors() > 0 ) { early_shutdown(); exit(1); }