1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-09 23:33:46 -05:00

Lock down the search path for Windows DLL loading.

At least on systems providing SetDefaultDllDirectories, this should
stop PuTTY from being willing to load DLLs from its containing
directory - which makes no difference when it's been properly
installed (in which case the application dir contains no DLLs anyway),
but does if it's being run from somewhere uncontrolled like a browser
downloads directory.

Preliminary testing suggests that this shouldn't break any existing
deliberate use of DLLs, including GSSAPI providers.
This commit is contained in:
Simon Tatham
2016-07-18 20:02:32 +01:00
parent f56dd17709
commit 9398d23033
7 changed files with 43 additions and 0 deletions

View File

@ -347,6 +347,8 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
HRESULT hr;
int guess_width, guess_height;
dll_hijacking_protection();
hinst = inst;
hwnd = NULL;
flags = FLAG_VERBOSE | FLAG_INTERACTIVE;