aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-03-15 19:39:03 +0100
committervan Hauser <vh@thc.org>2020-03-15 19:39:03 +0100
commit87599de782fc237de5c6f682651101c7f3523e3f (patch)
treebc284f07e9458d316d608ab84b50331ec1edad89
parent126d1f1cd14c6bb1fb59159965045f02d98d1b43 (diff)
downloadafl++-87599de782fc237de5c6f682651101c7f3523e3f.tar.gz
fix errors in last commit (u8)afl_get_env
-rw-r--r--include/afl-fuzz.h10
-rw-r--r--include/envs.h1
-rw-r--r--src/afl-fuzz-globals.c32
-rw-r--r--src/afl-fuzz-stats.c14
-rw-r--r--src/afl-fuzz.c2
5 files changed, 29 insertions, 30 deletions
diff --git a/include/afl-fuzz.h b/include/afl-fuzz.h
index fe3926a7..87903c33 100644
--- a/include/afl-fuzz.h
+++ b/include/afl-fuzz.h
@@ -304,12 +304,10 @@ extern char *power_names[POWER_SCHEDULES_NUM];
typedef struct afl_env_vars {
- u8 afl_skip_cpufreq, afl_exit_when_done, afl_no_affinity,
- afl_skip_bin_check, afl_dumb_forksrv,
- afl_import_first, afl_custom_mutator_only,
- afl_no_ui, afl_force_ui, afl_i_dont_care_about_missing_crashes,
- afl_bench_just_one, afl_bench_until_crash, afl_debug_child_output,
- afl_autoresume;
+ u8 afl_skip_cpufreq, afl_exit_when_done, afl_no_affinity, afl_skip_bin_check,
+ afl_dumb_forksrv, afl_import_first, afl_custom_mutator_only, afl_no_ui,
+ afl_force_ui, afl_i_dont_care_about_missing_crashes, afl_bench_just_one,
+ afl_bench_until_crash, afl_debug_child_output, afl_autoresume;
u8 *afl_tmpdir, *afl_post_library, *afl_custom_mutator_library,
*afl_python_module, *afl_path, *afl_hang_tmout, *afl_skip_crashes,
diff --git a/include/envs.h b/include/envs.h
index 126d9901..0651f9da 100644
--- a/include/envs.h
+++ b/include/envs.h
@@ -1,2 +1,3 @@
extern char *afl_environment_variables[];
+
diff --git a/src/afl-fuzz-globals.c b/src/afl-fuzz-globals.c
index b45943ce..55d24496 100644
--- a/src/afl-fuzz-globals.c
+++ b/src/afl-fuzz-globals.c
@@ -147,98 +147,98 @@ void read_afl_environment(afl_state_t *afl, char **envp) {
if (strncmp(env, "AFL_SKIP_CPUFREQ",
strlen(afl_environment_variables[i]) == 0)) {
- afl->afl_env.afl_skip_cpufreq = (u8)get_afl_env(env);
+ afl->afl_env.afl_skip_cpufreq = get_afl_env(env) ? 1 : 0;
} else if (!strncmp(env, "AFL_EXIT_WHEN_DONE",
strlen(afl_environment_variables[i]))) {
- afl->afl_env.afl_exit_when_done = (u8)get_afl_env(env);
+ afl->afl_env.afl_exit_when_done = get_afl_env(env) ? 1 : 0;
} else if (!strncmp(env, "AFL_NO_AFFINITY",
strlen(afl_environment_variables[i]))) {
- afl->afl_env.afl_no_affinity = (u8)get_afl_env(env);
+ afl->afl_env.afl_no_affinity = get_afl_env(env) ? 1 : 0;
} else if (!strncmp(env, "AFL_SKIP_CRASHES",
strlen(afl_environment_variables[i]))) {
- afl->afl_env.afl_skip_crashes = (u8)get_afl_env(env);
+ afl->afl_env.afl_skip_crashes = (u8 *)get_afl_env(env);
} else if (!strncmp(env, "AFL_HANG_TMOUT",
strlen(afl_environment_variables[i]))) {
- afl->afl_env.afl_hang_tmout = (u8)get_afl_env(env);
+ afl->afl_env.afl_hang_tmout = (u8 *)get_afl_env(env);
} else if (!strncmp(env, "AFL_SKIP_BIN_CHECK",
strlen(afl_environment_variables[i]))) {
- afl->afl_env.afl_skip_bin_check = (u8)get_afl_env(env);
+ afl->afl_env.afl_skip_bin_check = get_afl_env(env) ? 1 : 0;
} else if (!strncmp(env, "AFL_DUMB_FORKSRV",
strlen(afl_environment_variables[i]))) {
- afl->afl_env.afl_dumb_forksrv = (u8)get_afl_env(env);
+ afl->afl_env.afl_dumb_forksrv = get_afl_env(env) ? 1 : 0;
} else if (!strncmp(env, "AFL_IMPORT_FIRST",
strlen(afl_environment_variables[i]))) {
- afl->afl_env.afl_import_first = (u8)get_afl_env(env);
+ afl->afl_env.afl_import_first = get_afl_env(env) ? 1 : 0;
} else if (!strncmp(env, "AFL_CUSTOM_MUTATOR_ONLY",
strlen(afl_environment_variables[i]))) {
- afl->afl_env.afl_custom_mutator_only = (u8)get_afl_env(env);
+ afl->afl_env.afl_custom_mutator_only = get_afl_env(env) ? 1 : 0;
} else if (!strncmp(env, "AFL_NO_UI",
strlen(afl_environment_variables[i]))) {
- afl->afl_env.afl_no_ui = (u8)get_afl_env(env);
+ afl->afl_env.afl_no_ui = get_afl_env(env) ? 1 : 0;
} else if (!strncmp(env, "AFL_FORCE_UI",
strlen(afl_environment_variables[i]))) {
- afl->afl_env.afl_force_ui = (u8)get_afl_env(env);
+ afl->afl_env.afl_force_ui = get_afl_env(env) ? 1 : 0;
} else if (!strncmp(env, "AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES",
strlen(afl_environment_variables[i]))) {
afl->afl_env.afl_i_dont_care_about_missing_crashes =
- (u8)get_afl_env(env);
+ get_afl_env(env) ? 1 : 0;
} else if (!strncmp(env, "AFL_BENCH_JUST_ONE",
strlen(afl_environment_variables[i]))) {
- afl->afl_env.afl_bench_just_one = (u8)get_afl_env(env);
+ afl->afl_env.afl_bench_just_one = get_afl_env(env) ? 1 : 0;
} else if (!strncmp(env, "AFL_BENCH_UNTIL_CRASH",
strlen(afl_environment_variables[i]))) {
- afl->afl_env.afl_bench_until_crash = (u8)get_afl_env(env);
+ afl->afl_env.afl_bench_until_crash = get_afl_env(env) ? 1 : 0;
} else if (!strncmp(env, "AFL_DEBUG_CHILD_OUTPUT",
strlen(afl_environment_variables[i]))) {
- afl->afl_env.afl_debug_child_output = (u8)get_afl_env(env);
+ afl->afl_env.afl_debug_child_output = get_afl_env(env) ? 1 : 0;
} else if (!strncmp(env, "AFL_AUTORESUME",
strlen(afl_environment_variables[i]))) {
- afl->afl_env.afl_autoresume = (u8)get_afl_env(env);
+ afl->afl_env.afl_autoresume = get_afl_env(env) ? 1 : 0;
} else if (!strncmp(env, "AFL_TMPDIR",
diff --git a/src/afl-fuzz-stats.c b/src/afl-fuzz-stats.c
index 0885c906..c09fcb98 100644
--- a/src/afl-fuzz-stats.c
+++ b/src/afl-fuzz-stats.c
@@ -347,9 +347,9 @@ void show_stats(afl_state_t *afl) {
/* Lord, forgive me this. */
- SAYF(SET_G1 bSTG bLT bH bSTOP cCYA
+ SAYF(SET_G1 bSTG bLT bH bSTOP cCYA
" process timing " bSTG bH30 bH5 bH bHB bH bSTOP cCYA
- " overall results " bSTG bH2 bH2 bRT "\n");
+ " overall results " bSTG bH2 bH2 bRT "\n");
if (afl->dumb_mode) {
@@ -429,9 +429,9 @@ void show_stats(afl_state_t *afl) {
" uniq hangs : " cRST "%-6s" bSTG bV "\n",
DTD(cur_ms, afl->last_hang_time), tmp);
- SAYF(bVR bH bSTOP cCYA
+ SAYF(bVR bH bSTOP cCYA
" cycle progress " bSTG bH10 bH5 bH2 bH2 bHB bH bSTOP cCYA
- " map coverage " bSTG bH bHT bH20 bH2 bVL "\n");
+ " map coverage " bSTG bH bHT bH20 bH2 bVL "\n");
/* This gets funny because we want to print several variable-length variables
together, but then cram them into a fixed-width field - so we need to
@@ -460,9 +460,9 @@ void show_stats(afl_state_t *afl) {
SAYF(bSTOP " count coverage : " cRST "%-21s" bSTG bV "\n", tmp);
- SAYF(bVR bH bSTOP cCYA
+ SAYF(bVR bH bSTOP cCYA
" stage progress " bSTG bH10 bH5 bH2 bH2 bX bH bSTOP cCYA
- " findings in depth " bSTG bH10 bH5 bH2 bH2 bVL "\n");
+ " findings in depth " bSTG bH10 bH5 bH2 bH2 bVL "\n");
sprintf(tmp, "%s (%0.02f%%)", DI(afl->queued_favored),
((double)afl->queued_favored) * 100 / afl->queued_paths);
@@ -533,7 +533,7 @@ void show_stats(afl_state_t *afl) {
/* Aaaalmost there... hold on! */
- SAYF(bVR bH cCYA bSTOP
+ SAYF(bVR bH cCYA bSTOP
" fuzzing strategy yields " bSTG bH10 bHT bH10 bH5 bHB bH bSTOP cCYA
" path geometry " bSTG bH5 bH2 bVL "\n");
diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c
index ad619b1e..1c594168 100644
--- a/src/afl-fuzz.c
+++ b/src/afl-fuzz.c
@@ -139,7 +139,7 @@ static void usage(afl_state_t *afl, u8 *argv0, int more_help) {
"Other stuff:\n"
" -T text - text banner to show on the screen\n"
- " -M / -S id - distributed mode (see parallel_fuzzing.md)\n"
+ " -M / -S id - distributed mode (see docs/parallel_fuzzing.md)\n"
" -I command - execute this command/script when a new crash is "
"found\n"
" -B bitmap.txt - mutate a specific test case, use the out/fuzz_bitmap "