about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2023-03-30 20:02:59 +0200
committervanhauser-thc <vh@thc.org>2023-03-30 20:02:59 +0200
commit74baebd93e6ad65de297e812d53f06592166ef9a (patch)
tree5961523d981a37bcbbab8f5f0e2fe2b054a44866 /src
parent506f6b134987d47da6c1a2e172f50b47559e7b4f (diff)
downloadafl++-74baebd93e6ad65de297e812d53f06592166ef9a.tar.gz
fix
Diffstat (limited to 'src')
-rw-r--r--src/afl-fuzz-one.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/afl-fuzz-one.c b/src/afl-fuzz-one.c
index 36259d9b..fc37d493 100644
--- a/src/afl-fuzz-one.c
+++ b/src/afl-fuzz-one.c
@@ -2134,11 +2134,11 @@ havoc_stage:
      where we take the input file and make random stacked tweaks. */
 
   u32   r_max, mutation_array_len;
-  u32 **mutation_array;
+  u32 *mutation_array;
 
   // if ( ... )
   mutation_array = (u32 **)&mutation_array_explore;
-  mutation_array_len = sizeof(mutation_array_explore) + 1;
+  mutation_array_len = sizeof(mutation_array_explore) / 4;
 
   r_max = mutation_array_len;
   // + (afl->extras_cnt ? 2 : 0) + (afl->a_extras_cnt ? 2 : 0);
@@ -2191,7 +2191,8 @@ havoc_stage:
 
       }
 
-      switch (*mutation_array[rand_below(afl, r_max)]) {
+      u32 r = rand_below(afl, r_max);
+      switch (mutation_array[r]) {
 
         case 0: {