changeset 43832:e137338e926b

fuzz: make standalone_fuzz_target_runner call LLVMFuzzerInitialize Otherwise some of our fuzzers crash when they try and use Python. Differential Revision: https://phab.mercurial-scm.org/D7565
author Augie Fackler <augie@google.com>
date Fri, 06 Dec 2019 15:07:06 -0500
parents 5a9e2ae9899b
children 19da643dc10c
files contrib/fuzz/standalone_fuzz_target_runner.cc
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/fuzz/standalone_fuzz_target_runner.cc	Fri Dec 06 15:19:47 2019 -0500
+++ b/contrib/fuzz/standalone_fuzz_target_runner.cc	Fri Dec 06 15:07:06 2019 -0500
@@ -17,8 +17,12 @@
 // We deliberately keep this inteface simple and header-free.
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
 
+extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv);
+
 int main(int argc, char **argv)
 {
+	LLVMFuzzerInitialize(&argc, &argv);
+
 	for (int i = 1; i < argc; i++) {
 		std::ifstream in(argv[i]);
 		in.seekg(0, in.end);