From e8a3f46814303f434e33750ed05094a0f26980f0 Mon Sep 17 00:00:00 2001 From: Dominik Loidolt <dominik.loidolt@univie.ac.at> Date: Fri, 17 Jan 2025 16:07:17 +0100 Subject: [PATCH] debug printf --- test/fuzz/fuzz_cmp_tool.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/fuzz/fuzz_cmp_tool.c b/test/fuzz/fuzz_cmp_tool.c index f46dc34..8481583 100644 --- a/test/fuzz/fuzz_cmp_tool.c +++ b/test/fuzz/fuzz_cmp_tool.c @@ -151,6 +151,7 @@ err: static void add_argument_with_file(char **argv, int index, const char *flag, const char *file) { if (index >= 0) { + printf("allo arrgv[%d]",index); argv[index] = FUZZ_malloc(FILE_ARG_SIZE); memcpy(argv[index], flag, strlen(flag) + 1); strcat(argv[index], file); @@ -207,9 +208,12 @@ char **gen_argv(FUZZ_dataProducer_t *producer, int *argc, char *data_file, void free_argv(int argc, char **argv) { - while (argc--) { - free(argv[argc]); - argv[argc] = NULL; + int i; + + for (i = 0; i < argc; ++i) { + printf("free arrgv[%d]",i); + free(argv[i]); + argv[i] = NULL; } free(argv); } @@ -265,11 +269,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *src, size_t 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 */ int argc = 0; char **argv = NULL; - uint32_t size32 = (uint32_t)size; char *data_file = get_file(producer, &src, &size32); char *model_file = get_file(producer, &src, &size32); char *info_file = get_file(producer, &src, &size32); -- GitLab