diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2016-08-08 16:27:41 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-08-08 19:36:55 +0300 |
commit | 3bf142c77337814458ed8e036796934032d9837f (patch) | |
tree | e9c0b272b7dd1f189beefb57d9955f8bf22599a4 /cmdutils.c | |
parent | dbd7a84c814161926e5f298eae1f5ea17082f814 (diff) |
cmdutils: remove the current working directory from the DLL search path on win32
Reviewed-by: Matt Oliver <protogonoi@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'cmdutils.c')
-rw-r--r-- | cmdutils.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cmdutils.c b/cmdutils.c index 03a4836207..6960f8c99c 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -107,6 +107,15 @@ static void log_callback_report(void *ptr, int level, const char *fmt, va_list v } } +void init_dynload(void) +{ +#ifdef _WIN32 + /* Calling SetDllDirectory with the empty string (but not NULL) removes the + * current working directory from the DLL search path as a security pre-caution. */ + SetDllDirectory(""); +#endif +} + static void (*program_exit)(int ret); void register_exit(void (*cb)(int ret)) |