Skip to content
Snippets Groups Projects
Commit e8a3f468 authored by Dominik Loidolt's avatar Dominik Loidolt
Browse files

debug printf

parent b7f9474b
No related branches found
No related tags found
No related merge requests found
...@@ -151,6 +151,7 @@ err: ...@@ -151,6 +151,7 @@ err:
static void add_argument_with_file(char **argv, int index, const char *flag, const char *file) static void add_argument_with_file(char **argv, int index, const char *flag, const char *file)
{ {
if (index >= 0) { if (index >= 0) {
printf("allo arrgv[%d]",index);
argv[index] = FUZZ_malloc(FILE_ARG_SIZE); argv[index] = FUZZ_malloc(FILE_ARG_SIZE);
memcpy(argv[index], flag, strlen(flag) + 1); memcpy(argv[index], flag, strlen(flag) + 1);
strcat(argv[index], file); strcat(argv[index], file);
...@@ -207,9 +208,12 @@ char **gen_argv(FUZZ_dataProducer_t *producer, int *argc, char *data_file, ...@@ -207,9 +208,12 @@ char **gen_argv(FUZZ_dataProducer_t *producer, int *argc, char *data_file,
void free_argv(int argc, char **argv) void free_argv(int argc, char **argv)
{ {
while (argc--) { int i;
free(argv[argc]);
argv[argc] = NULL; for (i = 0; i < argc; ++i) {
printf("free arrgv[%d]",i);
free(argv[i]);
argv[i] = NULL;
} }
free(argv); free(argv);
} }
...@@ -265,11 +269,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size) ...@@ -265,11 +269,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size)
{ {
FUZZ_dataProducer_t *producer = FUZZ_dataProducer_create(src, size); FUZZ_dataProducer_t *producer = FUZZ_dataProducer_create(src, size);
size = FUZZ_dataProducer_reserveDataPrefix(producer); uint32_t size32 = (uint32_t)FUZZ_dataProducer_reserveDataPrefix(producer);
/* Create an array to hold the input arguments */ /* Create an array to hold the input arguments */
int argc = 0; int argc = 0;
char **argv = NULL; char **argv = NULL;
uint32_t size32 = (uint32_t)size;
char *data_file = get_file(producer, &src, &size32); char *data_file = get_file(producer, &src, &size32);
char *model_file = get_file(producer, &src, &size32); char *model_file = get_file(producer, &src, &size32);
char *info_file = get_file(producer, &src, &size32); char *info_file = get_file(producer, &src, &size32);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment