]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fuzzer: Honour -D dictdir when using jobs=N option
authorTerry Burton <tez@terryburton.co.uk>
Fri, 22 Jan 2021 14:21:49 +0000 (14:21 +0000)
committerAlan DeKok <aland@freeradius.org>
Sat, 23 Jan 2021 12:49:10 +0000 (07:49 -0500)
src/bin/fuzzer.c

index 1fb8cb390b1fe56ce9d7a5b506e99629979d16b2..b61cd5a1b44ed3401d739b79381162eaa82cbf31 100644 (file)
@@ -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;