Use proper AFL_NYX_AUX_SIZE for nyx_aux_string

This commit is contained in:
Christian Holler (:decoder)
2023-10-20 00:07:35 +02:00
parent 51f6229612
commit bfb841d013
3 changed files with 11 additions and 4 deletions

View File

@ -615,8 +615,10 @@ void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv,
if (getenv("AFL_NYX_AUX_SIZE") != NULL) {
fsrv->nyx_aux_string_len = atoi(getenv("AFL_NYX_AUX_SIZE"));
if (fsrv->nyx_handlers->nyx_config_set_aux_buffer_size(
nyx_config, atoi(getenv("AFL_NYX_AUX_SIZE"))) != 1) {
nyx_config, fsrv->nyx_aux_string_len) != 1) {
NYX_PRE_FATAL(fsrv,
"Invalid AFL_NYX_AUX_SIZE value set (must be a multiple "
@ -624,6 +626,10 @@ void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv,
}
} else {
fsrv->nyx_aux_string_len = 0x1000;
}
if (getenv("AFL_NYX_REUSE_SNAPSHOT") != NULL) {
@ -697,8 +703,8 @@ void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv,
fsrv->nyx_handlers->nyx_option_set_timeout(fsrv->nyx_runner, 2, 0);
fsrv->nyx_handlers->nyx_option_apply(fsrv->nyx_runner);
fsrv->nyx_aux_string = malloc(0x1000);
memset(fsrv->nyx_aux_string, 0, 0x1000);
fsrv->nyx_aux_string = malloc(fsrv->nyx_aux_string_len);
memset(fsrv->nyx_aux_string, 0, fsrv->nyx_aux_string_len);
/* dry run */
fsrv->nyx_handlers->nyx_set_afl_input(fsrv->nyx_runner, "INIT", 4);