https://git.reactos.org/?p=reactos.git;a=commitdiff;h=876711581630c42f9f696…
commit 876711581630c42f9f6962cedd2d79c7fa1f7546
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Fri Jan 25 13:17:45 2019 +0100
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Fri Jan 25 13:17:45 2019 +0100
[CREDUI] Sync with Wine Staging 4.0. CORE-15682
---
dll/win32/credui/credui_main.c | 23 +++++++++++++++--------
media/doc/README.WINE | 2 +-
2 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/dll/win32/credui/credui_main.c b/dll/win32/credui/credui_main.c
index bf9f7d186e..99aa9a12dd 100644
--- a/dll/win32/credui/credui_main.c
+++ b/dll/win32/credui/credui_main.c
@@ -89,7 +89,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID
lpvReserved)
HeapFree(GetProcessHeap(), 0, entry->pszTargetName);
HeapFree(GetProcessHeap(), 0, entry->pszUsername);
- ZeroMemory(entry->pszPassword, (strlenW(entry->pszPassword) + 1) *
sizeof(WCHAR));
+ SecureZeroMemory(entry->pszPassword, strlenW(entry->pszPassword) *
sizeof(WCHAR));
HeapFree(GetProcessHeap(), 0, entry->pszPassword);
HeapFree(GetProcessHeap(), 0, entry);
}
@@ -160,20 +160,27 @@ static void CredDialogFillUsernameCombo(HWND hwndUsername, const
struct cred_dia
DWORD j;
BOOL duplicate = FALSE;
+ if (!credentials[i]->UserName)
+ continue;
+
if (params->dwFlags & CREDUI_FLAGS_GENERIC_CREDENTIALS)
{
- if ((credentials[i]->Type != CRED_TYPE_GENERIC) ||
!credentials[i]->UserName)
+ if (credentials[i]->Type != CRED_TYPE_GENERIC)
+ {
+ credentials[i]->UserName = NULL;
continue;
+ }
}
- else
+ else if (credentials[i]->Type == CRED_TYPE_GENERIC)
{
- if (credentials[i]->Type == CRED_TYPE_GENERIC)
- continue;
+ credentials[i]->UserName = NULL;
+ continue;
}
/* don't add another item with the same name if we've already added it
*/
for (j = 0; j < i; j++)
- if (!strcmpW(credentials[i]->UserName, credentials[j]->UserName))
+ if (credentials[j]->UserName
+ && !strcmpW(credentials[i]->UserName,
credentials[j]->UserName))
{
duplicate = TRUE;
break;
@@ -673,7 +680,7 @@ DWORD WINAPI CredUIPromptForCredentialsW(PCREDUI_INFOW pUIInfo,
{
found = TRUE;
HeapFree(GetProcessHeap(), 0, entry->pszUsername);
- ZeroMemory(entry->pszPassword, (strlenW(entry->pszPassword) +
1) * sizeof(WCHAR));
+ SecureZeroMemory(entry->pszPassword,
strlenW(entry->pszPassword) * sizeof(WCHAR));
HeapFree(GetProcessHeap(), 0, entry->pszPassword);
}
@@ -733,7 +740,7 @@ DWORD WINAPI CredUIConfirmCredentialsW(PCWSTR pszTargetName, BOOL
bConfirm)
HeapFree(GetProcessHeap(), 0, entry->pszTargetName);
HeapFree(GetProcessHeap(), 0, entry->pszUsername);
- ZeroMemory(entry->pszPassword, (strlenW(entry->pszPassword) + 1) *
sizeof(WCHAR));
+ SecureZeroMemory(entry->pszPassword, strlenW(entry->pszPassword) *
sizeof(WCHAR));
HeapFree(GetProcessHeap(), 0, entry->pszPassword);
HeapFree(GetProcessHeap(), 0, entry);
diff --git a/media/doc/README.WINE b/media/doc/README.WINE
index 577d4748c2..532d520a7e 100644
--- a/media/doc/README.WINE
+++ b/media/doc/README.WINE
@@ -57,7 +57,7 @@ reactos/dll/win32/comcat # Synced to WineStaging-3.3
reactos/dll/win32/comctl32 # Synced to Wine-3.0
reactos/dll/win32/comdlg32 # Synced to WineStaging-4.0
reactos/dll/win32/compstui # Synced to WineStaging-3.3
-reactos/dll/win32/credui # Synced to WineStaging-3.17
+reactos/dll/win32/credui # Synced to WineStaging-4.0
reactos/dll/win32/crypt32 # Synced to WineStaging-3.17
reactos/dll/win32/cryptdlg # Synced to WineStaging-3.3
reactos/dll/win32/cryptdll # Synced to WineStaging-3.3