diff options
author | vanhauser-thc <vh@thc.org> | 2022-02-08 18:33:59 +0100 |
---|---|---|
committer | vanhauser-thc <vh@thc.org> | 2022-02-08 18:33:59 +0100 |
commit | 05a36f10ba99a461647a41433f199dd4ebc95e57 (patch) | |
tree | f0341ce5847ea804437fdcd1d8e0aa077c59446a /instrumentation/afl-compiler-rt.o.c | |
parent | cbf3d1bdeeb077c2a1754f777e4469c1ed9c760d (diff) | |
download | afl++-05a36f10ba99a461647a41433f199dd4ebc95e57.tar.gz |
import mozilla afl-cc patch
Diffstat (limited to 'instrumentation/afl-compiler-rt.o.c')
-rw-r--r-- | instrumentation/afl-compiler-rt.o.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/instrumentation/afl-compiler-rt.o.c b/instrumentation/afl-compiler-rt.o.c index 59839750..9a12831e 100644 --- a/instrumentation/afl-compiler-rt.o.c +++ b/instrumentation/afl-compiler-rt.o.c @@ -282,11 +282,9 @@ static void __afl_map_shm(void) { char *id_str = getenv(SHM_ENV_VAR); - if (__afl_final_loc) { ++__afl_final_loc; } // as we count starting 0 - if (__afl_final_loc) { - __afl_map_size = __afl_final_loc; + __afl_map_size = ++__afl_final_loc; // as we count starting 0 if (__afl_final_loc > MAP_SIZE) { @@ -333,14 +331,14 @@ static void __afl_map_shm(void) { if (__afl_debug) { - fprintf(stderr, - "DEBUG: (1) id_str %s, __afl_area_ptr %p, __afl_area_initial %p, " - "__afl_area_ptr_dummy %p, __afl_map_addr 0x%llx, MAP_SIZE %u, " - "__afl_final_loc %u, " - "max_size_forkserver %u/0x%x\n", - id_str == NULL ? "<null>" : id_str, __afl_area_ptr, - __afl_area_initial, __afl_area_ptr_dummy, __afl_map_addr, MAP_SIZE, - __afl_final_loc, FS_OPT_MAX_MAPSIZE, FS_OPT_MAX_MAPSIZE); + fprintf( + stderr, + "DEBUG: (1) id_str %s, __afl_area_ptr %p, __afl_area_initial %p, " + "__afl_area_ptr_dummy %p, __afl_map_addr 0x%llx, MAP_SIZE %u, " + "__afl_final_loc %u, __afl_map_size %u, max_size_forkserver %u/0x%x\n", + id_str == NULL ? "<null>" : id_str, __afl_area_ptr, __afl_area_initial, + __afl_area_ptr_dummy, __afl_map_addr, MAP_SIZE, __afl_final_loc, + __afl_map_size, FS_OPT_MAX_MAPSIZE, FS_OPT_MAX_MAPSIZE); } @@ -487,11 +485,12 @@ static void __afl_map_shm(void) { fprintf(stderr, "DEBUG: (2) id_str %s, __afl_area_ptr %p, __afl_area_initial %p, " "__afl_area_ptr_dummy %p, __afl_map_addr 0x%llx, MAP_SIZE " - "%u, __afl_final_loc %u, " + "%u, __afl_final_loc %u, __afl_map_size %u," "max_size_forkserver %u/0x%x\n", id_str == NULL ? "<null>" : id_str, __afl_area_ptr, __afl_area_initial, __afl_area_ptr_dummy, __afl_map_addr, MAP_SIZE, - __afl_final_loc, FS_OPT_MAX_MAPSIZE, FS_OPT_MAX_MAPSIZE); + __afl_final_loc, __afl_map_size, FS_OPT_MAX_MAPSIZE, + FS_OPT_MAX_MAPSIZE); } |