commit | c9a71337d9c0310c8439eb4bb8f046d252bac32e | [log] [tgz] |
---|---|---|
author | Haris Andrianakis <haris@coredump.gr> | Mon May 09 21:56:30 2016 -0700 |
committer | Haris Andrianakis <haris@coredump.gr> | Mon May 09 21:56:30 2016 -0700 |
tree | efe08b2e7b03ca00cda01d90c0321e4d75af881e | |
parent | a82258492b689ede2596500754c57229e3a18641 [diff] [blame] |
Fix race condition when writting the report.
diff --git a/fuzz.c b/fuzz.c index 693ab8a..b2c7436 100644 --- a/fuzz.c +++ b/fuzz.c
@@ -625,7 +625,10 @@ } } - report_Report(hfuzz, fuzzer->report); + { + MX_SCOPED_LOCK(&hfuzz->report_mutex); + report_Report(hfuzz, fuzzer->report); + } if (state == _HF_STATE_DYNAMIC_PRE && ATOMIC_PRE_INC(hfuzz->doneFileIndex) >= hfuzz->fileCnt) { fuzz_setState(hfuzz, _HF_STATE_DYNAMIC_MAIN);