[ADVAPI32]

- Correctly handle NULL passwords for services. Patch by Hermès Bélusca. Fixes crash in advapi32_winetest:service. See bug 7239, bug 7293.

svn path=/trunk/; revision=57150
This commit is contained in:
Thomas Faber
2012-08-24 12:52:29 +00:00
parent afd0458148
commit 7eaab92549
+4 -4
View File
@@ -309,7 +309,7 @@ ChangeServiceConfigA(SC_HANDLE hService,
/* FIXME: Encrypt the password */
lpEncryptedPassword = (LPBYTE)lpPassword;
dwPasswordLength = (strlen(lpPassword) + 1) * sizeof(CHAR);
dwPasswordLength = (lpPassword ? (strlen(lpPassword) + 1) * sizeof(CHAR) : 0);
RpcTryExcept
{
@@ -387,7 +387,7 @@ ChangeServiceConfigW(SC_HANDLE hService,
/* FIXME: Encrypt the password */
lpEncryptedPassword = (LPBYTE)lpPassword;
dwPasswordLength = (wcslen(lpPassword) + 1) * sizeof(WCHAR);
dwPasswordLength = (lpPassword ? (wcslen(lpPassword) + 1) * sizeof(WCHAR) : 0);
RpcTryExcept
{
@@ -577,7 +577,7 @@ CreateServiceA(SC_HANDLE hSCManager,
/* FIXME: Encrypt the password */
lpEncryptedPassword = (LPBYTE)lpPassword;
dwPasswordLength = (strlen(lpPassword) + 1) * sizeof(CHAR);
dwPasswordLength = (lpPassword ? (strlen(lpPassword) + 1) * sizeof(CHAR) : 0);
RpcTryExcept
{
@@ -671,7 +671,7 @@ CreateServiceW(SC_HANDLE hSCManager,
/* FIXME: Encrypt the password */
lpEncryptedPassword = (LPBYTE)lpPassword;
dwPasswordLength = (wcslen(lpPassword) + 1) * sizeof(WCHAR);
dwPasswordLength = (lpPassword ? (wcslen(lpPassword) + 1) * sizeof(WCHAR) : 0);
RpcTryExcept
{