about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2021-05-17 11:02:28 +0200
committervanhauser-thc <vh@thc.org>2021-05-17 11:04:03 +0200
commit7b033367c2f49b47d0a5021a9ad9a82b514429de (patch)
tree3ea805d7848d55579b3a4338c952d5295779cbfc
parent3d28925c13b5fc171b239c0c0451686967ee3bda (diff)
downloadafl++-7b033367c2f49b47d0a5021a9ad9a82b514429de.tar.gz
restrict afl-showmap in_file size
-rw-r--r--src/afl-showmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/afl-showmap.c b/src/afl-showmap.c
index 946b19cd..5994101e 100644
--- a/src/afl-showmap.c
+++ b/src/afl-showmap.c
@@ -386,7 +386,7 @@ static u32 read_file(u8 *in_file) {
 
   }
 
-  in_len = st.st_size;
+  in_len = st.st_size > MAX_FILE ? MAX_FILE : st.st_size;
   in_data = ck_alloc_nozero(in_len);
 
   ck_read(fd, in_data, in_len, in_file);