better cmp map fsrv fix
MODIFY
src/afl-forkserver.c
src/afl-forkserver.c
@@ -58,7 +58,9 @@ static list_t fsrv_list = {.element_prealloc_count = 0};
static void fsrv_exec_child(afl_forkserver_t *fsrv, char **argv) {
- if (fsrv->qemu_mode) setenv("AFL_DISABLE_LLVM_INSTRUMENTATION", "1", 0);
+ if (fsrv->qemu_mode) { setenv("AFL_DISABLE_LLVM_INSTRUMENTATION", "1", 0); }
+
+ unsetenv(CMPLOG_SHM_ENV_VAR); // we do not want that in non-cmplog fsrv
execv(fsrv->target_path, argv);

MODIFY
src/afl-fuzz-cmplog.c
src/afl-fuzz-cmplog.c
@@ -33,6 +33,8 @@ void cmplog_exec_child(afl_forkserver_t *fsrv, char **argv) {
setenv("___AFL_EINS_ZWEI_POLIZEI___", "1", 1);
+ if (fsrv->qemu_mode) { setenv("AFL_DISABLE_LLVM_INSTRUMENTATION", "1", 0); }
+
if (!fsrv->qemu_mode && argv[0] != fsrv->cmplog_binary) {
argv[0] = fsrv->cmplog_binary;

MODIFY
src/afl-fuzz.c
src/afl-fuzz.c
@@ -1515,21 +1515,7 @@ int main(int argc, char **argv_orig, char **envp) {
}
- u8 *save_env = NULL;
- if (afl->cmplog_binary) {
-
- save_env = ck_strdup(getenv(CMPLOG_SHM_ENV_VAR));
- unsetenv(CMPLOG_SHM_ENV_VAR); // normal forkserver should not have this
-
- }
-
perform_dry_run(afl);
- if (save_env) {
-
- setenv(CMPLOG_SHM_ENV_VAR, save_env, 1); // needed for at_exit()
- ck_free(save_env);
-
- }
/*
if (!user_set_cache && afl->q_testcase_max_cache_size) {

better cmp map fsrv fix