[llvm] [Windows] Avoid loading shared libraries from load directory (PR #90520)

Daniel Paoliello via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 29 16:31:31 PDT 2024


================
@@ -43,6 +43,10 @@ InitLLVM::InitLLVM(int &Argc, const char **&Argv,
   assert(!Initialized && "InitLLVM was already initialized!");
   Initialized = true;
 #endif
+#ifdef _WIN32
+  // Avoid searching the directory from which the application is loaded.
----------------
dpaoliello wrote:

For reference: <https://devblogs.microsoft.com/oldnewthing/20121031-00/?p=6203>
"Remember, the directory is the application bundle. If you drop your application into a random directory, you’ve just added everything in that directory to your bundle. And if you don’t secure your application directory, you’re allowing anybody to add components to your bundle."

https://github.com/llvm/llvm-project/pull/90520


More information about the llvm-commits mailing list