From ef6bd3ee39ab6d84d025a9e7bd564705c673dbef Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Thu, 4 Jun 2020 15:11:56 -0700 Subject: [PATCH] Fix use-after-move of proc_status_file breaking -U flag --- CHANGES | 7 +++++++ VERSION | 2 +- src/zeek-setup.cc | 2 +- testing/btest/Baseline/core.proc-status-file/status-file | 1 + testing/btest/core/proc-status-file.zeek | 2 ++ 5 files changed, 12 insertions(+), 2 deletions(-) create mode 100755 testing/btest/Baseline/core.proc-status-file/status-file create mode 100644 testing/btest/core/proc-status-file.zeek diff --git a/CHANGES b/CHANGES index 6a315b1871..bc706714fc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,10 @@ + +3.2.0-dev.744 | 2020-06-04 15:11:56 -0700 + + * Fix use-after-move of proc_status_file breaking -U flag (Jon Siwek, Corelight) + + * Change Cirrus CI config to use org-level secured variable (Jon Siwek, Corelight) + 3.2.0-dev.742 | 2020-06-03 13:29:12 -0700 * GH-973: Fix the return type of topk_get_top() diff --git a/VERSION b/VERSION index ed72656886..d5213f7871 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.2.0-dev.742 +3.2.0-dev.744 diff --git a/src/zeek-setup.cc b/src/zeek-setup.cc index e204e59b3e..988b7abb7c 100644 --- a/src/zeek-setup.cc +++ b/src/zeek-setup.cc @@ -457,7 +457,7 @@ zeek::detail::SetupResult zeek::detail::setup(int argc, char** argv, } if ( options.process_status_file ) - proc_status_file = options.process_status_file->data(); + proc_status_file = copy_string(options.process_status_file->data()); atexit(atexit_handler); set_processing_status("INITIALIZING", "main"); diff --git a/testing/btest/Baseline/core.proc-status-file/status-file b/testing/btest/Baseline/core.proc-status-file/status-file new file mode 100755 index 0000000000..c21c495960 --- /dev/null +++ b/testing/btest/Baseline/core.proc-status-file/status-file @@ -0,0 +1 @@ +TERMINATED [atexit] diff --git a/testing/btest/core/proc-status-file.zeek b/testing/btest/core/proc-status-file.zeek new file mode 100644 index 0000000000..ff69a86116 --- /dev/null +++ b/testing/btest/core/proc-status-file.zeek @@ -0,0 +1,2 @@ +# @TEST-EXEC: zeek -b -U status-file -e '' +# @TEST-EXEC: btest-diff status-file