about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-03-22 09:26:46 +0100
committervan Hauser <vh@thc.org>2020-03-22 09:26:46 +0100
commit5a0cc43ee142842d845a0281fa8f5d0d0721a8ba (patch)
treeae17254425d47bd24114f33ca2eadf1d873e81ee
parentf08a3fedf684a52b7999b1305248812a21927b99 (diff)
downloadafl++-5a0cc43ee142842d845a0281fa8f5d0d0721a8ba.tar.gz
all afl msgs to stdout and only read AFL_BENCH_JUST_ONE once
-rw-r--r--docs/Changelog.md2
-rw-r--r--include/debug.h4
-rw-r--r--src/afl-fuzz.c4
3 files changed, 8 insertions, 2 deletions
diff --git a/docs/Changelog.md b/docs/Changelog.md
index ece2c4b5..8e63c388 100644
--- a/docs/Changelog.md
+++ b/docs/Changelog.md
@@ -20,6 +20,8 @@ sending a mail to <afl-users+subscribe@googlegroups.com>.
       multiple fuzzing threads in the future or even become a library
     - afl basic tools now report on the environment variables picked up
     - more tools get environment variable usage info in the help output
+    - force all output to stdout (some OK/SAY/WARN messages were sent to
+      stdout, some to stderr)
   - afl-fuzz:
     - python mutator modules and custom mutator modules now use the same
       interface and hence the API changed
diff --git a/include/debug.h b/include/debug.h
index b3865c19..6ced60b1 100644
--- a/include/debug.h
+++ b/include/debug.h
@@ -32,6 +32,10 @@
  * Terminal colors *
  *******************/
 
+#ifndev MESSAGES_TO_STDOUT
+#define MESSAGES_TO_STDOUT
+#endif
+
 #ifdef USE_COLOR
 
 #define cBLK "\x1b[0;30m"
diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c
index 15caa65f..cc22fd5c 100644
--- a/src/afl-fuzz.c
+++ b/src/afl-fuzz.c
@@ -230,8 +230,7 @@ int main(int argc, char **argv_orig, char **envp) {
   u64    prev_queued = 0;
   u32    sync_interval_cnt = 0, seek_to, show_help = 0;
   u8 *   extras_dir = 0;
-  u8     mem_limit_given = 0;
-  u8     exit_1 = !!get_afl_env("AFL_BENCH_JUST_ONE");
+  u8     mem_limit_given = 0, exit_1 = 0;
   char **use_argv;
 
   struct timeval  tv;
@@ -246,6 +245,7 @@ int main(int argc, char **argv_orig, char **envp) {
   afl_fsrv_init(&afl->fsrv);
 
   read_afl_environment(afl, envp);
+  exit_1 = !!afl->afl_env.afl_bench_just_one;
 
   SAYF(cCYA "afl-fuzz" VERSION cRST
             " based on afl by Michal Zalewski and a big online community\n");