Author: tfaber
Date: Fri Aug 24 12:52:29 2012
New Revision: 57150
URL:
http://svn.reactos.org/svn/reactos?rev=57150&view=rev
Log:
[ADVAPI32]
- Correctly handle NULL passwords for services. Patch by Hermès Bélusca. Fixes crash in
advapi32_winetest:service. See bug 7239, bug 7293.
Modified:
trunk/reactos/dll/win32/advapi32/service/scm.c
Modified: trunk/reactos/dll/win32/advapi32/service/scm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/service…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/service/scm.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/service/scm.c [iso-8859-1] Fri Aug 24 12:52:29 2012
@@ -309,7 +309,7 @@
/* 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 @@
/* 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 @@
/* 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 @@
/* FIXME: Encrypt the password */
lpEncryptedPassword = (LPBYTE)lpPassword;
- dwPasswordLength = (wcslen(lpPassword) + 1) * sizeof(WCHAR);
+ dwPasswordLength = (lpPassword ? (wcslen(lpPassword) + 1) * sizeof(WCHAR) : 0);
RpcTryExcept
{