mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 09:08:20 +00:00
Merge remote-tracking branch 'security/topic/awelzel/155-reassem-validate-seq-upper-overflow'
* security/topic/awelzel/155-reassem-validate-seq-upper-overflow: file_analysis/File: Report overflowing chunks as weird and discard/truncate Reassem: Reject blocks overflowing 64bit upper zeek-setup: Load scrips before running unit tests
This commit is contained in:
commit
d8c1a1babf
8 changed files with 122 additions and 19 deletions
|
@ -682,7 +682,7 @@ SetupResult setup(int argc, char** argv, Options* zopts)
|
|||
if ( options.plugins_to_load.empty() && options.scripts_to_load.empty() &&
|
||||
options.script_options_to_set.empty() && ! options.pcap_file && ! options.interface &&
|
||||
! options.identifier_to_print && ! command_line_policy && ! options.print_plugins &&
|
||||
! options.supervisor_mode && ! Supervisor::ThisNode() )
|
||||
! options.supervisor_mode && ! Supervisor::ThisNode() && ! options.run_unit_tests )
|
||||
add_input_file("-");
|
||||
|
||||
for ( const auto& script_option : options.script_options_to_set )
|
||||
|
@ -729,17 +729,6 @@ SetupResult setup(int argc, char** argv, Options* zopts)
|
|||
|
||||
plugin_mgr->ActivateDynamicPlugins(! options.bare_mode);
|
||||
|
||||
// Delay the unit test until here so that plugins have been loaded.
|
||||
if ( options.run_unit_tests )
|
||||
{
|
||||
set_signal_mask(false); // Allow ctrl-c to abort the tests early
|
||||
doctest::Context context;
|
||||
auto dargs = to_cargs(options.doctest_args);
|
||||
context.applyCommandLine(dargs.size(), dargs.data());
|
||||
ZEEK_LSAN_ENABLE();
|
||||
exit(context.run());
|
||||
}
|
||||
|
||||
// Print usage after plugins load so that any path extensions are properly shown.
|
||||
if ( options.print_usage )
|
||||
usage(argv[0], 0);
|
||||
|
@ -811,6 +800,18 @@ SetupResult setup(int argc, char** argv, Options* zopts)
|
|||
init_net_var();
|
||||
run_bif_initializers();
|
||||
|
||||
// Delay the unit test until here so that plugins and script
|
||||
// types have been fully loaded.
|
||||
if ( options.run_unit_tests )
|
||||
{
|
||||
set_signal_mask(false); // Allow ctrl-c to abort the tests early
|
||||
doctest::Context context;
|
||||
auto dargs = to_cargs(options.doctest_args);
|
||||
context.applyCommandLine(dargs.size(), dargs.data());
|
||||
ZEEK_LSAN_ENABLE();
|
||||
exit(context.run());
|
||||
}
|
||||
|
||||
// Assign the script_args for command line processing in Zeek scripts.
|
||||
if ( ! options.script_args.empty() )
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue