aboutsummaryrefslogtreecommitdiff
path: root/instrumentation
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2021-01-15 15:12:27 +0100
committervan Hauser <vh@thc.org>2021-01-15 15:12:27 +0100
commitfba8790e322ab933df9851f0cf6ce9ca941f3814 (patch)
tree826be81b77a39afd0fd7a66b488c356f292e7fc3 /instrumentation
parent8eb00a5dfab01330f576d173038a9561951371ec (diff)
downloadAFLplusplus-fba8790e322ab933df9851f0cf6ce9ca941f3814.tar.gz
better error reporting
Diffstat (limited to 'instrumentation')
-rw-r--r--instrumentation/afl-compiler-rt.o.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/instrumentation/afl-compiler-rt.o.c b/instrumentation/afl-compiler-rt.o.c
index f194510e..b735d8df 100644
--- a/instrumentation/afl-compiler-rt.o.c
+++ b/instrumentation/afl-compiler-rt.o.c
@@ -366,6 +366,18 @@ static void __afl_map_shm(void) {
#else
u32 shm_id = atoi(id_str);
+ if (__afl_map_size && __afl_map_size > MAP_SIZE) {
+
+ u8 *map_env = getenv("AFL_MAP_SIZE");
+ if (!map_env || atoi(map_env) < MAP_SIZE) {
+
+ send_forkserver_error(FS_ERROR_MAP_SIZE);
+ _exit(1);
+
+ }
+
+ }
+
__afl_area_ptr = shmat(shm_id, (void *)__afl_map_addr, 0);
/* Whooooops. */