aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Rooijakkers <thomas.rooijakkers@tno.nl>2020-09-04 13:13:47 +0200
committerThomas Rooijakkers <thomas.rooijakkers@tno.nl>2020-09-04 13:48:43 +0200
commite45ae8e5da9d603976a4fde1184455e5e9c49051 (patch)
tree1193d409baef2e7ffe9c2ed433afd02a6ae532fa
parentcea2fadbf4ca1b47be01aa1160d7a11a3a114840 (diff)
downloadafl++-e45ae8e5da9d603976a4fde1184455e5e9c49051.tar.gz
Export set afl_environment_variables to stats
-rw-r--r--README.md1
-rw-r--r--src/afl-fuzz-stats.c20
2 files changed, 20 insertions, 1 deletions
diff --git a/README.md b/README.md
index 6e5d9c1f..7b73a5f3 100644
--- a/README.md
+++ b/README.md
@@ -1035,6 +1035,7 @@ without feedback, bug reports, or patches from:
Andrea Biondo Vincent Le Garrec
Khaled Yakdan Kuang-che Wu
Josephine Calliotte Konrad Welc
+ Thomas Rooijakkers
```
Thank you!
diff --git a/src/afl-fuzz-stats.c b/src/afl-fuzz-stats.c
index 0ce35cb7..38c954e5 100644
--- a/src/afl-fuzz-stats.c
+++ b/src/afl-fuzz-stats.c
@@ -24,6 +24,7 @@
*/
#include "afl-fuzz.h"
+#include "envs.h"
#include <limits.h>
/* Update stats file for unattended monitoring. */
@@ -163,11 +164,28 @@ void write_stats_file(afl_state_t *afl, double bitmap_cvg, double stability,
? ""
: "default",
afl->orig_cmdline);
+
+ char * val;
+ uint32_t i = 0;
+ uint32_t s_afl_env =
+ sizeof(afl_environment_variables) / sizeof(afl_environment_variables[0]) -
+ 1;
+
+ for (i = 0; i < s_afl_env; i++) {
+
+ if ((val = get_afl_env(afl_environment_variables[i])) != NULL) {
+
+ fprintf(f, "%-18.*s: %s\n", strlen(afl_environment_variables[i]),
+ afl_environment_variables[i], val);
+
+ }
+
+ }
+
/* ignore errors */
if (afl->debug) {
- uint32_t i = 0;
fprintf(f, "virgin_bytes :");
for (i = 0; i < afl->fsrv.map_size; i++) {