This commit is contained in:
vanhauser-thc
2021-03-06 23:01:13 +01:00
parent 99b4c3f362
commit 7f062524c9
4 changed files with 36 additions and 32 deletions

View File

@ -986,6 +986,21 @@ int main(int argc, char **argv_orig, char **envp) {
}
if (unlikely(afl->afl_env.afl_persistent_record)) {
afl->fsrv.persistent_record = atoi(afl->afl_env.afl_persistent_record);
afl->fsrv.persistent_record_dir = alloc_printf("%s/crashes", afl->out_dir);
if (afl->fsrv.persistent_record < 2) {
FATAL(
"AFL_PERSISTENT_RECORD value must be be at least 2, recommended is "
"100 or 1000.");
}
}
if (afl->fsrv.qemu_mode && getenv("AFL_USE_QASAN")) {
u8 *preload = getenv("AFL_PRELOAD");
@ -1239,29 +1254,6 @@ int main(int argc, char **argv_orig, char **envp) {
}
if (unlikely(afl->afl_env.afl_persistent_record)) {
afl->fsrv.persistent_record = atoi(afl->afl_env.afl_persistent_record);
afl->fsrv.persistent_record_dir = alloc_printf("%s/crashes", afl->out_dir);
if (afl->fsrv.persistent_record < 2) {
FATAL(
"AFL_PERSISTENT_RECORD vallue must be be at least 2, recommended is "
"100 or 1000.");
}
if (!getenv(PERSIST_ENV_VAR)) {
FATAL(
"Target binary is not compiled in persistent mode, "
"AFL_PERSISTENT_RECORD makes no sense.");
}
}
if (afl->afl_env.afl_crash_exitcode) {
long exitcode = strtol(afl->afl_env.afl_crash_exitcode, NULL, 10);
@ -1531,6 +1523,18 @@ int main(int argc, char **argv_orig, char **envp) {
check_binary(afl, argv[optind]);
if (unlikely(afl->fsrv.persistent_record)) {
if (!getenv(PERSIST_ENV_VAR)) {
FATAL(
"Target binary is not compiled in persistent mode, "
"AFL_PERSISTENT_RECORD makes no sense.");
}
}
if (afl->shmem_testcase_mode) { setup_testcase_shmem(afl); }
afl->start_time = get_cur_time();