Commit 3acde309 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

credui: Correctly check for duplicated username entries in CredDialogFillUsernameCombo.

parent 43275fb1
...@@ -160,20 +160,27 @@ static void CredDialogFillUsernameCombo(HWND hwndUsername, const struct cred_dia ...@@ -160,20 +160,27 @@ static void CredDialogFillUsernameCombo(HWND hwndUsername, const struct cred_dia
DWORD j; DWORD j;
BOOL duplicate = FALSE; BOOL duplicate = FALSE;
if (!credentials[i]->UserName)
continue;
if (params->dwFlags & CREDUI_FLAGS_GENERIC_CREDENTIALS) 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; continue;
} }
else }
else if (credentials[i]->Type == CRED_TYPE_GENERIC)
{ {
if (credentials[i]->Type == CRED_TYPE_GENERIC) credentials[i]->UserName = NULL;
continue; continue;
} }
/* don't add another item with the same name if we've already added it */ /* don't add another item with the same name if we've already added it */
for (j = 0; j < i; j++) 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; duplicate = TRUE;
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment