adjustment

This commit is contained in:
Yassine Ferhane
2025-04-06 01:37:15 +02:00
parent 27b18e6267
commit 757184e611

View File

@ -475,7 +475,7 @@ if (afl && afl->custom_mutators_count) {
} }
// Skip built-in minimization if custom trimmer is successful // Skip built-in minimization if custom trimmer is successful
if (custom_trimmer_success) { if (in_len <= 1) {
if (tmp_buf) { ck_free(tmp_buf); } if (tmp_buf) { ck_free(tmp_buf); }
return; return;
} }
@ -1361,8 +1361,8 @@ int main(int argc, char **argv_orig, char **envp) {
// Initialize AFL state for custom mutators // Initialize AFL state for custom mutators
afl = calloc(1, sizeof(afl_state_t)); afl = calloc(1, sizeof(afl_state_t));
if (afl) { if (afl) {
afl->fsrv.dev_urandom_fd = open("/dev/urandom", O_RDONLY); int urandom_fd = open("/dev/urandom", O_RDONLY);
if (afl->fsrv.dev_urandom_fd < 0) { PFATAL("Unable to open /dev/urandom"); } if (urandom_fd < 0) { PFATAL("Unable to open /dev/urandom"); }
list_init(&afl->custom_mutator_list); list_init(&afl->custom_mutator_list);
afl->custom_mutators_count = 0; afl->custom_mutators_count = 0;
@ -1370,11 +1370,12 @@ int main(int argc, char **argv_orig, char **envp) {
afl->afl_env.afl_custom_mutator_library = getenv("AFL_CUSTOM_MUTATOR_LIBRARY"); afl->afl_env.afl_custom_mutator_library = getenv("AFL_CUSTOM_MUTATOR_LIBRARY");
afl->afl_env.afl_python_module = getenv("AFL_PYTHON_MODULE"); afl->afl_env.afl_python_module = getenv("AFL_PYTHON_MODULE");
afl->fsrv = *fsrv;
afl->shm = shm; afl->shm = shm;
afl->out_dir = "."; // Répertoire temporaire afl->out_dir = ".";
afl->fsrv.use_shmem_fuzz = fsrv->use_shmem_fuzz;
memcpy(&afl->fsrv, fsrv, sizeof(afl_forkserver_t));
afl->fsrv.dev_urandom_fd = urandom_fd;
setup_custom_mutators(afl); setup_custom_mutators(afl);
} }