about summary refs log tree commit diff
path: root/instrumentation/afl-compiler-rt.o.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2022-08-25 15:56:36 +0200
committerGitHub <noreply@github.com>2022-08-25 15:56:36 +0200
commit413e68ab6d588b12976c5ff34e1a27eae48c26d8 (patch)
tree24ac9dc2eb3bf5c3f114e9e0abb52729f893b8ed /instrumentation/afl-compiler-rt.o.c
parent3e2986dd78dbc45035b47a34eedd7dd1b9a4d0b3 (diff)
parenteb5a914ef670d43cc41ce130edb4e0586d97e278 (diff)
downloadafl++-413e68ab6d588b12976c5ff34e1a27eae48c26d8.tar.gz
Merge pull request #1499 from AFLplusplus/dev
push to stable
Diffstat (limited to 'instrumentation/afl-compiler-rt.o.c')
-rw-r--r--instrumentation/afl-compiler-rt.o.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/instrumentation/afl-compiler-rt.o.c b/instrumentation/afl-compiler-rt.o.c
index 97974c4a..1759898e 100644
--- a/instrumentation/afl-compiler-rt.o.c
+++ b/instrumentation/afl-compiler-rt.o.c
@@ -288,11 +288,18 @@ static void __afl_map_shm(void) {
 
     __afl_map_size = ++__afl_final_loc;  // as we count starting 0
 
+    if (getenv("AFL_DUMP_MAP_SIZE")) {
+
+      printf("%u\n", __afl_map_size);
+      exit(-1);
+
+    }
+
     if (__afl_final_loc > MAP_SIZE) {
 
       char *ptr;
       u32   val = 0;
-      if ((ptr = getenv("AFL_MAP_SIZE")) != NULL) val = atoi(ptr);
+      if ((ptr = getenv("AFL_MAP_SIZE")) != NULL) { val = atoi(ptr); }
       if (val < __afl_final_loc) {
 
         if (__afl_final_loc > FS_OPT_MAX_MAPSIZE) {
@@ -325,6 +332,15 @@ static void __afl_map_shm(void) {
 
     }
 
+  } else {
+
+    if (getenv("AFL_DUMP_MAP_SIZE")) {
+
+      printf("%u\n", MAP_SIZE);
+      exit(-1);
+
+    }
+
   }
 
   if (!id_str && __afl_area_ptr_dummy == __afl_area_initial) {