about summary refs log tree commit diff
path: root/src/afl-forkserver.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2023-10-21 09:18:15 +0200
committerGitHub <noreply@github.com>2023-10-21 09:18:15 +0200
commitb50b2e822f410c10e3e3ce9f20ba4547f2e0cbc4 (patch)
treec8c3c7f2b002f200dfa567acb0312d5b9f6ea365 /src/afl-forkserver.c
parent51f62296126d9d29c955e4f127d04da4395a8e0d (diff)
parentbfb841d01383a4801a28b007c5f7039f2f28bef9 (diff)
downloadafl++-b50b2e822f410c10e3e3ce9f20ba4547f2e0cbc4.tar.gz
Merge pull request #1894 from choller/dev
Use proper AFL_NYX_AUX_SIZE for nyx_aux_string
Diffstat (limited to 'src/afl-forkserver.c')
-rw-r--r--src/afl-forkserver.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/afl-forkserver.c b/src/afl-forkserver.c
index 07f5a1a9..9b710733 100644
--- a/src/afl-forkserver.c
+++ b/src/afl-forkserver.c
@@ -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);