Merge branch 'mingw-load-sys-dlls'

This patch has been carried by Git for Windows for almost two years. It
makes loading system libraries safer.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2018-10-12 22:41:18 +02:00
2 changed files with 4 additions and 2 deletions

View File

@@ -1797,7 +1797,8 @@ static void ensure_socket_initialization(void)
WSAGetLastError());
for (name = libraries; *name; name++) {
ipv6_dll = LoadLibrary(*name);
ipv6_dll = LoadLibraryExA(*name, NULL,
LOAD_LIBRARY_SEARCH_SYSTEM32);
if (!ipv6_dll)
continue;

View File

@@ -75,7 +75,8 @@ static CredDeleteWT CredDeleteW;
static void load_cred_funcs(void)
{
/* load DLLs */
advapi = LoadLibrary("advapi32.dll");
advapi = LoadLibraryExA("advapi32.dll", NULL,
LOAD_LIBRARY_SEARCH_SYSTEM32);
if (!advapi)
die("failed to load advapi32.dll");