From: Terry Burton Date: Fri, 22 Jan 2021 14:21:49 +0000 (+0000) Subject: Fuzzer: Honour -D dictdir when using jobs=N option X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2d6d2e2b817f6fc6a8709b354fd0609e3eaec2ff;p=thirdparty%2Ffreeradius-server.git Fuzzer: Honour -D dictdir when using jobs=N option --- diff --git a/src/bin/fuzzer.c b/src/bin/fuzzer.c index 1fb8cb390b1..b61cd5a1b44 100644 --- a/src/bin/fuzzer.c +++ b/src/bin/fuzzer.c @@ -95,6 +95,16 @@ int LLVMFuzzerInitialize(int *argc, char ***argv) if (!dict_dir) dict_dir = DICTDIR; + /* + * When jobs=N is specified the fuzzer spawns worker processes via + * a shell. We have removed any -D dictdir argument that were + * supplied, so we pass it to our children via the environment. + */ + if (setenv("FR_DICTIONARY_DIR", dict_dir, 1)) { + fprintf(stderr, "Failed to set FR_DICTIONARY_DIR env variable\n"); + fr_exit_now(1); + } + if (!fr_dict_global_ctx_init(NULL, dict_dir)) { fr_perror("dict_global"); return 0;