Patchwork D7565: fuzz: make standalone_fuzz_target_runner call LLVMFuzzerInitialize

login
register
mail settings
Submitter phabricator
Date Dec. 7, 2019, 4:04 a.m.
Message ID <22ba940080ced5be5715d8bc63e75b56@localhost.localdomain>
Download mbox | patch
Permalink /patch/43625/
State Not Applicable
Headers show

Comments

phabricator - Dec. 7, 2019, 4:04 a.m.
Closed by commit rHG01ec70a80a7b: fuzz: make standalone_fuzz_target_runner call LLVMFuzzerInitialize (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7565?vs=18503&id=18516

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7565/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7565

AFFECTED FILES
  contrib/fuzz/standalone_fuzz_target_runner.cc

CHANGE DETAILS




To: durin42, #hg-reviewers, indygreg
Cc: mercurial-devel

Patch

diff --git a/contrib/fuzz/standalone_fuzz_target_runner.cc b/contrib/fuzz/standalone_fuzz_target_runner.cc
--- a/contrib/fuzz/standalone_fuzz_target_runner.cc
+++ b/contrib/fuzz/standalone_fuzz_target_runner.cc
@@ -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);