From 915616a34e67d082e3db6928a5712cc8bf75c937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Thu, 13 Aug 2020 17:55:38 +0200 Subject: [PATCH] Move the debug variable from main.c to individual fuzzer The fuzzers needs to be completely independent of the main.c for OSS-Fuzz to work. --- fuzz/dns_name_fromtext_target.c | 2 ++ fuzz/dns_rdata_fromwire_text.c | 2 ++ fuzz/isc_lex_getmastertoken.c | 2 ++ fuzz/isc_lex_gettoken.c | 2 ++ fuzz/main.c | 2 -- 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/fuzz/dns_name_fromtext_target.c b/fuzz/dns_name_fromtext_target.c index e85e61e33a..f412bfd036 100644 --- a/fuzz/dns_name_fromtext_target.c +++ b/fuzz/dns_name_fromtext_target.c @@ -20,6 +20,8 @@ #include "fuzz.h" +bool debug = false; + static isc_mem_t *mctx = NULL; int diff --git a/fuzz/dns_rdata_fromwire_text.c b/fuzz/dns_rdata_fromwire_text.c index a71ba5ef37..82941143a6 100644 --- a/fuzz/dns_rdata_fromwire_text.c +++ b/fuzz/dns_rdata_fromwire_text.c @@ -28,6 +28,8 @@ #include "fuzz.h" +bool debug = false; + /* * Fuzz input to dns_rdata_fromwire(). Then convert the result * to text, back to wire format, to multiline text, and back to wire diff --git a/fuzz/isc_lex_getmastertoken.c b/fuzz/isc_lex_getmastertoken.c index 2649dd0cfb..64d4727332 100644 --- a/fuzz/isc_lex_getmastertoken.c +++ b/fuzz/isc_lex_getmastertoken.c @@ -20,6 +20,8 @@ #include "fuzz.h" +bool debug = false; + int LLVMFuzzerInitialize(int *argc __attribute__((unused)), char ***argv __attribute__((unused))); diff --git a/fuzz/isc_lex_gettoken.c b/fuzz/isc_lex_gettoken.c index c87086bb27..2fed94bcf6 100644 --- a/fuzz/isc_lex_gettoken.c +++ b/fuzz/isc_lex_gettoken.c @@ -19,6 +19,8 @@ #include "fuzz.h" +bool debug = false; + static isc_mem_t *mctx = NULL; static isc_lex_t *lex = NULL; diff --git a/fuzz/main.c b/fuzz/main.c index 85a9031a0f..d95d6f3fca 100644 --- a/fuzz/main.c +++ b/fuzz/main.c @@ -24,8 +24,6 @@ #include -bool debug = false; - static void test_all_from(const char *dirname) { DIR *dirp;