The maximum size for the input size was set to INPUT_SIZE, which is actually
the size of the data array inside the fuzz_corpus structure and so was not
abling user (or AFL) to fill in the whole structure. Changing to
sizeof(struct fuzz_corpus) correct this problem.
Signed-off-by: Paul Semel <semelpaul@gmail.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
unsigned char data[INPUT_SIZE];
} input;
#define DATA_OFFSET offsetof(struct fuzz_corpus, data)
+#define FUZZ_CORPUS_SIZE (sizeof(struct fuzz_corpus))
/*
* Internal state of the fuzzing harness. Calculated initially from the input
return 1;
}
- if ( size > INPUT_SIZE )
+ if ( size > FUZZ_CORPUS_SIZE )
{
printf("Input too large\n");
return 1;
unsigned int fuzz_minimal_input_size(void)
{
- BUILD_BUG_ON(DATA_OFFSET > INPUT_SIZE);
-
return DATA_OFFSET + 1;
}