secur32: fix to conversion of password in NTLM AcquireCredentialsHandleA

Kai Blin blin at
Fri Dec 9 05:16:11 CST 2005

When converting the password from multibyte to widechar, the end of
string character
wasn't accounted for. Thanks to Marcus Meissner for pointing that out.

Kai Blin  <blin at>
Fix multibyte to widechar conversion of password in
Kai Blin, (blin at gmx dot net)
Emacs, n.:
	A slow-moving parody of a text editor.
-------------- next part --------------
diff --git a/dlls/secur32/ntlm.c b/dlls/secur32/ntlm.c
index 94715b5..3de699f 100644
--- a/dlls/secur32/ntlm.c
+++ b/dlls/secur32/ntlm.c
@@ -353,7 +353,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_Ac
                 passwd = HeapAlloc(GetProcessHeap(), 0, passwd_sizeW
                     * sizeof(SEC_WCHAR));
                 MultiByteToWideChar(CP_ACP, 0, (LPCSTR)identity->Password,
-                    identity->PasswordLength, passwd, passwd_sizeW);
+                    identity->PasswordLength+1, passwd, passwd_sizeW);

More information about the wine-patches mailing list