about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYour Name <you@example.com>2021-08-25 18:34:39 +0100
committerYour Name <you@example.com>2021-08-25 18:34:39 +0100
commitedda239131164945068d967acae813156a352898 (patch)
treec214ac397bb305e54ae343aa2207e13df653e6e6
parente25f7cefdc796e2e52f53388492d476c52d3e251 (diff)
downloadafl++-edda239131164945068d967acae813156a352898.tar.gz
Fix issues with cmplog caused by coverage writing to STDIN
-rw-r--r--frida_mode/src/instrument/instrument_coverage.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/frida_mode/src/instrument/instrument_coverage.c b/frida_mode/src/instrument/instrument_coverage.c
index 4c0d1a14..b3323e1d 100644
--- a/frida_mode/src/instrument/instrument_coverage.c
+++ b/frida_mode/src/instrument/instrument_coverage.c
@@ -13,7 +13,7 @@
 char *instrument_coverage_filename = NULL;
 
 static int         coverage_fd = -1;
-static int         coverage_pipes[2] = {0};
+static int         coverage_pipes[2] = {-1, -1};
 static uint64_t    coverage_last_start = 0;
 static GHashTable *coverage_hash = NULL;
 static GArray *    coverage_modules = NULL;
@@ -353,12 +353,16 @@ void instrument_coverage_init(void) {
 
 void instrument_coverage_start(uint64_t address) {
 
+  if (instrument_coverage_filename == NULL) { return; }
+
   coverage_last_start = address;
 
 }
 
 void instrument_coverage_end(uint64_t address) {
 
+  if (instrument_coverage_filename == NULL) { return; }
+
   coverage_data_t data = {
 
       .start = coverage_last_start, .end = address, .module = NULL};