fix plot_data output and code-format
MODIFY
docs/Changelog.md
docs/Changelog.md
@@ -19,14 +19,17 @@ sending a mail to <afl-users+subscribe@googlegroups.com>.
- snapshot feature usage now visible in UI
- Now setting "-L -1" will enable MOpt in parallel to normal mutation.
Additionally this allows to run dictionaries, radamsa and cmplog.
+ - fix for cmplog/redqueen mode if stdin was used
+ - fix for writing a better plot_data file
+ - qemu_mode: fix for persistent mode
- compare-transform/AFL_LLVM_LAF_TRANSFORM_COMPARES now transforms also
static global and local variable comparisons (cannot find all though)
- extended forkserver: map_size and more information is communicated to
afl-fuzz (and afl-fuzz acts accordingly)
- - more refactoring
- if AFL_CC/AFL_CXX is set but empty afl compilers did fail, fixed
(this bug is in vanilla afl too)
- added NO_PYTHON flag to disable python support when building afl-fuzz
+ - more refactoring
### Version ++2.63c (release):

MODIFY
src/afl-fuzz-init.c
src/afl-fuzz-init.c
@@ -1419,6 +1419,8 @@ void setup_dirs_fds(afl_state_t *afl) {
"# unix_time, cycles_done, cur_path, paths_total, "
"pending_total, pending_favs, map_size, unique_crashes, "
"unique_hangs, max_depth, execs_per_sec\n");
+ fflush(afl->fsrv.plot_file);
+
/* ignore errors */
}

MODIFY
src/afl-fuzz-stats.c
src/afl-fuzz-stats.c
@@ -145,14 +145,15 @@ void write_stats_file(afl_state_t *afl, double bitmap_cvg, double stability,
void maybe_update_plot_file(afl_state_t *afl, double bitmap_cvg, double eps) {
- if (afl->plot_prev_qp == afl->queued_paths &&
+ if (unlikely(afl->plot_prev_qp == afl->queued_paths &&
afl->plot_prev_pf == afl->pending_favored &&
afl->plot_prev_pnf == afl->pending_not_fuzzed &&
afl->plot_prev_ce == afl->current_entry &&
afl->plot_prev_qc == afl->queue_cycle &&
afl->plot_prev_uc == afl->unique_crashes &&
afl->plot_prev_uh == afl->unique_hangs &&
- afl->plot_prev_md == afl->max_depth)
+ afl->plot_prev_md == afl->max_depth) ||
+ unlikely(!afl->queue_cycle))
return;
afl->plot_prev_qp = afl->queued_paths;

MODIFY
src/afl-showmap.c
src/afl-showmap.c
@@ -218,8 +218,8 @@ static u32 write_results_to_file(afl_forkserver_t *fsrv, u8 *outfile) {
/* Execute target application. */
-static void showmap_run_target_forkserver(afl_forkserver_t *fsrv, char **argv, u8 *mem,
- u32 len) {
+static void showmap_run_target_forkserver(afl_forkserver_t *fsrv, char **argv,
+ u8 *mem, u32 len) {
afl_fsrv_write_to_testcase(fsrv, mem, len);

fix plot_data output and code-format