about summary refs log tree commit diff
path: root/src/afl-forkserver.c
diff options
context:
space:
mode:
authorSergej Schumilo <sergej@schumilo.de>2022-03-04 05:41:40 +0100
committerSergej Schumilo <sergej@schumilo.de>2022-03-04 05:41:40 +0100
commit0f7419fc9166b1f719372e1658efc4e3b9c88ac5 (patch)
tree2d2c5b932af7873b12ebc4eb72c317048e7516fc /src/afl-forkserver.c
parent7c9b7c0bc0f17f19e39684c4a066c10d08743672 (diff)
downloadafl++-0f7419fc9166b1f719372e1658efc4e3b9c88ac5.tar.gz
write nyx crash logs to AFL++ work directory
Diffstat (limited to 'src/afl-forkserver.c')
-rw-r--r--src/afl-forkserver.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/afl-forkserver.c b/src/afl-forkserver.c
index 8997781d..54f28852 100644
--- a/src/afl-forkserver.c
+++ b/src/afl-forkserver.c
@@ -450,6 +450,9 @@ 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);
+
     /* dry run */
     fsrv->nyx_handlers->nyx_set_afl_input(fsrv->nyx_runner, "INIT", 4);
     switch (fsrv->nyx_handlers->nyx_exec(fsrv->nyx_runner)) {
@@ -1253,7 +1256,10 @@ void afl_fsrv_kill(afl_forkserver_t *fsrv) {
   fsrv->child_pid = -1;
 
 #ifdef __linux__
-  if (fsrv->nyx_mode) { fsrv->nyx_handlers->nyx_shutdown(fsrv->nyx_runner); }
+  if (fsrv->nyx_mode) {
+    free(fsrv->nyx_aux_string);
+    fsrv->nyx_handlers->nyx_shutdown(fsrv->nyx_runner); 
+  }
 #endif
 
 }