about summary refs log tree commit diff
path: root/examples/custom_mutators/example.c
diff options
context:
space:
mode:
authorh1994st <h1994st@gmail.com>2020-03-04 14:58:29 -0500
committerh1994st <h1994st@gmail.com>2020-03-04 14:58:29 -0500
commit9e5c4973eb8f9b2f007bb1fe10976a4634c0ea6a (patch)
tree50e39e2f7e5014ab83c4194119e8f1b8150034c1 /examples/custom_mutators/example.c
parent70a67ca67d0ea105d2b75dae388be03051cf0bf3 (diff)
downloadafl++-9e5c4973eb8f9b2f007bb1fe10976a4634c0ea6a.tar.gz
Fix variable name
Diffstat (limited to 'examples/custom_mutators/example.c')
-rw-r--r--examples/custom_mutators/example.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/custom_mutators/example.c b/examples/custom_mutators/example.c
index 63e4d6da..737cf631 100644
--- a/examples/custom_mutators/example.c
+++ b/examples/custom_mutators/example.c
@@ -40,7 +40,7 @@ void afl_custom_init(unsigned int seed) {
  * @return Size of the mutated output.
  */
 size_t afl_custom_fuzz(uint8_t *buf, size_t buf_size,
-                       uint8_t *add_buf,size_t add_buf_size, // add_buf can be NULL
+                       uint8_t *add_buf,size_t add_buf_size,
                        uint8_t *mutated_out, size_t max_size) {
 
   // Make sure that the packet size does not exceed the maximum size expected by
@@ -53,7 +53,7 @@ size_t afl_custom_fuzz(uint8_t *buf, size_t buf_size,
   // Mutate the payload of the packet
   for (int i = 3; i < mutated_size; i++) {
 
-    mutated_out[i] = (data[i] + rand() % 10) & 0xff;
+    mutated_out[i] = (buf[i] + rand() % 10) & 0xff;
 
   }
 
@@ -89,10 +89,10 @@ size_t afl_custom_pre_save(uint8_t *buf, size_t buf_size, uint8_t **out_buf) {
 
 }
 
-uint8_t *trim_buf;
-size_t trim_buf_size
-int trimmming_steps;
-int cur_step;
+static uint8_t *trim_buf;
+static size_t trim_buf_size;
+static int trimmming_steps;
+static int cur_step;
 
 /**
  * This method is called at the start of each trimming operation and receives