about summary refs log tree commit diff
path: root/src/afl-forkserver.c
diff options
context:
space:
mode:
authorDominik Maier <domenukk@gmail.com>2020-04-17 11:01:20 +0200
committerDominik Maier <domenukk@gmail.com>2020-04-17 11:01:20 +0200
commit90ff345d733caa51f6d2895dd229104c286b62c4 (patch)
tree9bf965a3e7f447ea0779848a6e09f9b356a0707e /src/afl-forkserver.c
parent8fa5d4c313372a337c7facf0428b0339babbe057 (diff)
parent2162fd8e1a1ceb745c1fcf87fb6a1053508591c4 (diff)
downloadafl++-90ff345d733caa51f6d2895dd229104c286b62c4.tar.gz
Merge branch 'dev' of github.com:aflplusplus/aflplusplus into dev
Diffstat (limited to 'src/afl-forkserver.c')
-rw-r--r--src/afl-forkserver.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/afl-forkserver.c b/src/afl-forkserver.c
index 006764d9..9b915a7a 100644
--- a/src/afl-forkserver.c
+++ b/src/afl-forkserver.c
@@ -407,21 +407,26 @@ void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv,
 
       if ((status & FS_OPT_MAPSIZE) == FS_OPT_MAPSIZE) {
 
-        fsrv->map_size = FS_OPT_GET_MAPSIZE(status);
-        if (unlikely(fsrv->map_size % 8)) {
+        u32 tmp_map_size = FS_OPT_GET_MAPSIZE(status);
+
+        if (!fsrv->map_size) fsrv->map_size = MAP_SIZE;
+
+        if (unlikely(tmp_map_size % 8)) {
 
           // should not happen
-          WARNF("Target reported non-aligned map size of %ud", fsrv->map_size);
-          fsrv->map_size = (((fsrv->map_size + 8) >> 3) << 3);
+          WARNF("Target reported non-aligned map size of %ud", tmp_map_size);
+          tmp_map_size = (((tmp_map_size + 8) >> 3) << 3);
 
         }
 
-        if (!be_quiet) ACTF("Target map size: %u", fsrv->map_size);
-        if (fsrv->map_size > MAP_SIZE)
+        if (!be_quiet) ACTF("Target map size: %u", tmp_map_size);
+        if (tmp_map_size > fsrv->map_size)
           FATAL(
               "Target's coverage map size of %u is larger than the one this "
-              "afl++ is compiled with (%u) (change MAP_SIZE and recompile)\n",
-              fsrv->map_size, MAP_SIZE);
+              "afl++ is set with (%u) (change MAP_SIZE_POW2 in config.h and "
+              "recompile or set AFL_MAP_SIZE)\n",
+              tmp_map_size, fsrv->map_size);
+        fsrv->map_size = tmp_map_size;
 
       }