From 76e15a06957d03df7ffc8102a043c7694ba251d6 Mon Sep 17 00:00:00 2001 From: van Hauser Date: Fri, 17 Apr 2020 11:56:08 +0200 Subject: refactoring getting the map size --- src/afl-fuzz.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'src/afl-fuzz.c') diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c index 03726eb0..83e25994 100644 --- a/src/afl-fuzz.c +++ b/src/afl-fuzz.c @@ -234,7 +234,7 @@ int main(int argc, char **argv_orig, char **envp) { s32 opt; u64 prev_queued = 0; u32 sync_interval_cnt = 0, seek_to, show_help = 0, map_size = MAP_SIZE; - u8 * extras_dir = 0, *ptr; + u8 * extras_dir = 0; u8 mem_limit_given = 0, exit_1 = 0; char **use_argv; @@ -247,19 +247,8 @@ int main(int argc, char **argv_orig, char **envp) { if (!afl) { FATAL("Could not create afl state"); } if (get_afl_env("AFL_DEBUG")) afl->debug = 1; - if ((ptr = get_afl_env("AFL_MAP_SIZE")) || - (ptr = get_afl_env("AFL_MAPSIZE"))) { - - map_size = atoi(ptr); - if (map_size < 8 || map_size > (1 << 29)) - FATAL( - "the specified AFL_MAP_SIZE size is illegal and must be between 2^3 " - "and 2^30: %u\n", - map_size); - if (map_size % 8) map_size = (((map_size >> 3) + 1) << 3); - - } + map_size = get_map_size(); afl_state_init(afl, map_size); afl_fsrv_init(&afl->fsrv); -- cgit 1.4.1