diff options
author | van Hauser <vh@thc.org> | 2024-10-30 13:20:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-30 13:20:48 +0100 |
commit | d0587a3ac46b1652b1b51b3253c9833d0ea06a13 (patch) | |
tree | f5d907aafec2fdfe4abca67f8357e9cb1b62d5f4 /instrumentation/afl-compiler-rt.o.c | |
parent | 78b7e14c73baacf1d88b3c03955e78f5080d17ba (diff) | |
parent | d1fd072b793cba16c28249abefe73ecb7feae4f2 (diff) | |
download | afl++-d0587a3ac46b1652b1b51b3253c9833d0ea06a13.tar.gz |
Merge pull request #2226 from AFLplusplus/dev
push to stable
Diffstat (limited to 'instrumentation/afl-compiler-rt.o.c')
-rw-r--r-- | instrumentation/afl-compiler-rt.o.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/instrumentation/afl-compiler-rt.o.c b/instrumentation/afl-compiler-rt.o.c index 0da689b2..77a9623c 100644 --- a/instrumentation/afl-compiler-rt.o.c +++ b/instrumentation/afl-compiler-rt.o.c @@ -367,6 +367,12 @@ static void __afl_map_shm(void) { } + if (__afl_debug) { + + fprintf(stderr, "DEBUG: AFL_MAP_SIZE=%u\n", __afl_map_size); + + } + if (__afl_final_loc > MAP_SIZE) { char *ptr; @@ -413,7 +419,7 @@ static void __afl_map_shm(void) { if ((ptr = getenv("AFL_MAP_SIZE")) != NULL) { val = atoi(ptr); } - if (val > MAP_INITIAL_SIZE) { + if (val > MAP_INITIAL_SIZE && val > __afl_final_loc) { __afl_map_size = val; @@ -630,21 +636,21 @@ static void __afl_map_shm(void) { __afl_area_ptr_dummy = (u8 *)malloc(__afl_map_size); - if (__afl_area_ptr_dummy) { + } - if (__afl_selective_coverage_start_off) { + if (__afl_area_ptr_dummy) { - __afl_area_ptr = __afl_area_ptr_dummy; + if (__afl_selective_coverage_start_off) { - } + __afl_area_ptr = __afl_area_ptr_dummy; - } else { + } - fprintf(stderr, "Error: __afl_selective_coverage failed!\n"); - __afl_selective_coverage = 0; - // continue; + } else { - } + fprintf(stderr, "Error: __afl_selective_coverage failed!\n"); + __afl_selective_coverage = 0; + // continue; } |