mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 09:58:01 +00:00
Fix loading of SSPICLI.DLL by SECUR32.DLL.
If MIT Kerberos is installed, then using GetProcAddress to extract GetUserNameExA() from secur32.dll causes Windows to implicitly load sspicli.dll in turn - and it does it in a search-path-unclean way. If we load it in our own way before that happens, then Windows doesn't need to load it again and won't do so wrongly. [SGT: tidied up commit message from original patch]
This commit is contained in:
parent
802b4edf4d
commit
3ff3be3882
@ -101,6 +101,11 @@ char *get_username(void)
|
||||
if (!tried_usernameex) {
|
||||
/* Not available on Win9x, so load dynamically */
|
||||
HMODULE secur32 = load_system32_dll("secur32.dll");
|
||||
/* If MIT Kerberos is installed, the following call to
|
||||
GET_WINDOWS_FUNCTION makes Windows implicitly load
|
||||
sspicli.dll WITHOUT proper path sanitizing, so better
|
||||
load it properly before */
|
||||
HMODULE sspicli = load_system32_dll("sspicli.dll");
|
||||
GET_WINDOWS_FUNCTION(secur32, GetUserNameExA);
|
||||
tried_usernameex = TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user