about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2021-05-17 13:11:16 +0200
committervanhauser-thc <vh@thc.org>2021-05-17 13:11:16 +0200
commita3fffac90cb96736395aa9764f4cc5aa20e6cd71 (patch)
tree4abfcc0974843dce35b7ab14756c4dc0f459a2c1 /src
parent738246465d07770471ec34500909ebb4c3c5f1cf (diff)
downloadafl++-a3fffac90cb96736395aa9764f4cc5aa20e6cd71.tar.gz
add warning for afl-showmap partial read
Diffstat (limited to 'src')
-rw-r--r--src/afl-showmap.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/afl-showmap.c b/src/afl-showmap.c
index 5994101e..41a62108 100644
--- a/src/afl-showmap.c
+++ b/src/afl-showmap.c
@@ -386,7 +386,18 @@ static u32 read_file(u8 *in_file) {
 
   }
 
-  in_len = st.st_size > MAX_FILE ? MAX_FILE : st.st_size;
+  if (st.st_size > MAX_FILE) {
+
+    WARNF("Input file '%s' is too large, only reading %u bytes.", in_file,
+          MAX_FILE);
+    in_len = MAX_FILE;
+
+  } else {
+
+    in_len = st.st_size;
+
+  }
+
   in_data = ck_alloc_nozero(in_len);
 
   ck_read(fd, in_data, in_len, in_file);