about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRishi Ranjan <rishiranjan9101@gmail.com>2020-07-29 01:05:05 +0530
committerRishi Ranjan <rishiranjan9101@gmail.com>2020-07-29 01:05:05 +0530
commit565da10a8f46e9910ac5edecb1c5e68ee8c66b0d (patch)
tree227ed9c982a0365d3d23732f703623dc3286fe8b /src
parent2fa31dab60e76ee1a4b77d2d98d58e0e35455880 (diff)
downloadafl++-565da10a8f46e9910ac5edecb1c5e68ee8c66b0d.tar.gz
Minor change to write_with_gap
Diffstat (limited to 'src')
-rw-r--r--src/afl-fuzz-run.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/afl-fuzz-run.c b/src/afl-fuzz-run.c
index 7d68083d..e4ddab1b 100644
--- a/src/afl-fuzz-run.c
+++ b/src/afl-fuzz-run.c
@@ -144,12 +144,12 @@ static void write_with_gap(afl_state_t *afl, void *mem, u32 len, u32 skip_at,
 
   /*
   This memory is used to carry out the post_processing(if present) after copying
-  the testcase by removing the gaps
+  the testcase by removing the gaps. This can break though
   */
-  u8 mem_trimmed[skip_at + tail_len +
+  u8 mem_trimmed[len - skip_len +
                  1];  // 1 extra size to remove chance of overflow
 
-  ssize_t new_size = skip_at + tail_len;
+  ssize_t new_size = len - skip_len;
   void *  new_mem = mem;
   u8 *    new_buf = NULL;