shithub: fuzz

Download patch

ref: 6c3d2706048bced9330aaa0b311acc5d664f5e31
parent: be56c70d35462c0ced615b81187689ea8829201c
parent: 07bca2887efd3c28059e7e081cc4cd9499279dea
author: seh <seh@localhost>
date: Sat Nov 24 13:29:59 EST 2018

hg said to merge

--- a/mutate.c
+++ b/mutate.c
@@ -53,14 +53,24 @@
 void
 mut_charstar(char** in_val, int *round)
 {
-    if(*round == ROUND_NUM)
+    // if not round 1, free the previously malloc-ed memory
+    if(*round != ROUND_NUM)
+        free(*in_val);
+
+    const int MAX_SIZE = 1024;
+    int size = rand() % MAX_SIZE + 1;
+
+    *in_val = malloc(sizeof(char) * size);
+
+    int i;
+    for(i = 0; i < size; i++)
     {
-        //*in_val = rand();
+        (*in_val)[i] = 'b';
     }
-    else
-    {
+    (*in_val)[size - 1] = '\0';
 
-    }
+
+    dolog("Value of in_val: %s\n", *in_val);
 }
 
 void