#include "misc.h"
#include "list.h"
-#define SUBBUFFER_SIZE 256
-
+/* Required for hash_init() */
static uint32_t
word_hash_function(const void *key, uint32_t iv)
{
return hash_func(key, sizeof(key), iv);
}
+/* Required for hash_init() */
static bool
word_compare_function(const void *key1, const void *key2)
{
return ((size_t)key1 & 0xFFF) == ((size_t)key1 & 0xFFF);
}
+/* Start of serialization of struct hash.
+ * This is necessary to test whether the data structure contains
+ * any uninitialized data. If it does, MemorySanitizer will detect
+ * it upon serialization */
static void serialize_hash_element(struct hash_element* he)
{
}
}
+/* End of serialization of struct hash */
+
int LLVMFuzzerInitialize(int *argc, char ***argv)
{
return 1;
}
+
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
struct gc_arena gc;
fuzzer_set_input((unsigned char*)data, size);
gc = gc_new();
+ /* Pseudo-randomize the number of loops */
FUZZER_GET_INTEGER(num_loops, 16);
for (i = 0; i < num_loops; i++)
{
+ /* Pick one of the functions */
FUZZER_GET_INTEGER(generic_ssizet, 7);
switch ( generic_ssizet )
{
break;
}
}
+
cleanup:
if ( hash )
{