From: Alan T. DeKok Date: Thu, 19 Jan 2023 22:21:25 +0000 (-0500) Subject: set global search path, so that the fuzzer can find things X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0225f078ab64dad855d00c36a1bb350ebc8ccdd0;p=thirdparty%2Ffreeradius-server.git set global search path, so that the fuzzer can find things --- diff --git a/src/bin/fuzzer.c b/src/bin/fuzzer.c index e897104a115..6312341a8bc 100644 --- a/src/bin/fuzzer.c +++ b/src/bin/fuzzer.c @@ -165,6 +165,14 @@ int LLVMFuzzerInitialize(int *argc, char ***argv) if (!dict_dir) dict_dir = DICTDIR; if (!lib_dir) lib_dir = LIBDIR; + /* + * Set the global search path for all dynamic libraries we load. + */ + if (dl_search_global_path_set(libdir) < 0) { + fr_perror("fuzzer: Failed setting library path); + fr_exit_now(EXIT_FAILURE); + } + /* * When jobs=N is specified the fuzzer spawns worker processes via * a shell. We have removed any -D dictdir argument that were @@ -202,7 +210,6 @@ int LLVMFuzzerInitialize(int *argc, char ***argv) fr_perror("fuzzer: Failed initializing library loader"); fr_exit_now(EXIT_FAILURE); } - dl_search_path_prepend(dl_loader, lib_dir); snprintf(buffer, sizeof(buffer), "libfreeradius-%s", proto); dl = dl_by_name(dl_loader, buffer, NULL, false);