about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/afl-common.c2
-rw-r--r--src/afl-forkserver.c9
-rw-r--r--src/afl-fuzz.c3
3 files changed, 11 insertions, 3 deletions
diff --git a/src/afl-common.c b/src/afl-common.c
index 04a984cb..e5584e93 100644
--- a/src/afl-common.c
+++ b/src/afl-common.c
@@ -108,7 +108,7 @@ void set_sanitizer_defaults() {
     if (!have_san_options) { strcpy(buf, default_options); }
     if (have_asan_options) {
 
-      if (NULL != strstr(have_asan_options, "detect_leaks=0")) {
+      if (NULL != strstr(have_asan_options, "detect_leaks=0") || NULL != strstr(have_asan_options, "detect_leaks=false")) {
 
         strcat(buf, "exitcode=" STRINGIFY(LSAN_ERROR) ":fast_unwind_on_malloc=0:print_suppressions=0:detect_leaks=0:malloc_context_size=0:");
 
diff --git a/src/afl-forkserver.c b/src/afl-forkserver.c
index 6366f473..5390b597 100644
--- a/src/afl-forkserver.c
+++ b/src/afl-forkserver.c
@@ -1338,6 +1338,10 @@ void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv,
 
           fsrv->map_size = tmp_map_size;
 
+        } else {
+           
+           fsrv->real_map_size = fsrv->map_size = MAP_SIZE;
+           
         }
 
         if ((status & FS_OPT_AUTODICT) == FS_OPT_AUTODICT) {
@@ -1444,6 +1448,11 @@ void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv,
 
         }
 
+      } else {
+
+         // The binary is most likely instrumented using AFL's tool, and we will set map_size to MAP_SIZE.
+         fsrv->real_map_size = fsrv->map_size = MAP_SIZE;
+         
       }
 
     }
diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c
index 9867eba3..1546597e 100644
--- a/src/afl-fuzz.c
+++ b/src/afl-fuzz.c
@@ -2237,7 +2237,6 @@ int main(int argc, char **argv_orig, char **envp) {
       snprintf(fn, PATH_MAX, "%s/fastresume.bin", afl->out_dir);
   #ifdef HAVE_ZLIB
       if ((fr_fd = ZLIBOPEN(fn, "rb")) != NULL) {
-
   #else
       if ((fr_fd = open(fn, O_RDONLY)) >= 0) {
 
@@ -3341,9 +3340,9 @@ stop_fuzzing:
     ACTF("Writing %s ...", fr);
   #ifdef HAVE_ZLIB
     if ((fr_fd = ZLIBOPEN(fr, "wb9")) != NULL) {
-
   #else
     if ((fr_fd = open(fr, O_WRONLY | O_TRUNC | O_CREAT, DEFAULT_PERMISSION)) >=
+        0) {
   #endif
 
       u8   ver_string[8];