From: Arran Cudbard-Bell Date: Tue, 2 Nov 2021 17:46:19 +0000 (-0400) Subject: Allow setting the debug level for fuzzer targets X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c37003101c8ca37ff12ae66a7a8f47f2387a3c1a;p=thirdparty%2Ffreeradius-server.git Allow setting the debug level for fuzzer targets It can be very useful for tracing protocol execution --- diff --git a/src/bin/fuzzer.c b/src/bin/fuzzer.c index afcbbd0416a..b851dfd07c9 100644 --- a/src/bin/fuzzer.c +++ b/src/bin/fuzzer.c @@ -64,13 +64,16 @@ static void exitHandler(void) int LLVMFuzzerInitialize(int *argc, char ***argv) { - char const *lib_dir = getenv("FR_LIBRARY_PATH"); - char const *proto = getenv("FR_LIBRARY_FUZZ_PROTOCOL"); - char const *dict_dir = getenv("FR_DICTIONARY_DIR"); + char const *lib_dir = getenv("FR_LIBRARY_PATH"); + char const *proto = getenv("FR_LIBRARY_FUZZ_PROTOCOL"); + char const *dict_dir = getenv("FR_DICTIONARY_DIR"); + char const *debug_lvl_str = getenv("FR_DEBUG_LVL"); char buffer[1024]; if (!argc || !argv || !*argv) return -1; /* shut up clang scan */ + if (debug_lvl_str) fr_debug_lvl = atoi(debug_lvl_str); + /* * Setup atexit handlers to free any thread local * memory on exit