Skip to content

Commit

Permalink
better harness
Browse files Browse the repository at this point in the history
--HG--
branch : fuzz
  • Loading branch information
mkj committed May 18, 2017
1 parent 6d33a2b commit a3e01b8
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion fuzz-harness.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
#include "includes.h"
#include "buffer.h"
#include "dbutil.h"

extern int LLVMFuzzerTestOneInput(const unsigned char *data, size_t size);

int main(int argc, char ** argv) {
LLVMFuzzerTestOneInput("hello", 5);
int i;
buffer *input = buf_new(100000);

for (i = 1; i < argc; i++) {
char* fn = argv[i];
buf_setlen(input, 0);
buf_readfile(input, fn);
buf_setpos(input, 0);

printf("Running %s\n", fn);
LLVMFuzzerTestOneInput(input->data, input->len);
printf("Done %s\n", fn);
}

printf("Finished\n");

return 0;
}

0 comments on commit a3e01b8

Please sign in to comment.