Author: ekohl
Date: Sat Jul 16 17:39:37 2016
New Revision: 71954
URL:
http://svn.reactos.org/svn/reactos?rev=71954&view=rev
Log:
[SERVICES]
Check for NULL pointers before derreferecing them in ScmIsSameServiceAccount().
Patch by Victor Martinez Calvo.
CORE-11599 #resolve #comment Thanks a lot!
Modified:
trunk/reactos/base/system/services/database.c
Modified: trunk/reactos/base/system/services/database.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/datab…
==============================================================================
--- trunk/reactos/base/system/services/database.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/services/database.c [iso-8859-1] Sat Jul 16 17:39:37 2016
@@ -162,10 +162,16 @@
IN PWSTR pszAccountName1,
IN PWSTR pszAccountName2)
{
- if ((pszAccountName1 == NULL && pszAccountName2 == NULL) ||
- (pszAccountName1 == NULL && wcscmp(pszAccountName2,
L"LocalSystem") == 0) ||
- (pszAccountName2 == NULL && wcscmp(pszAccountName1,
L"LocalSystem") == 0) ||
- (wcscmp(pszAccountName1, pszAccountName2) == 0))
+ if (pszAccountName1 == NULL && pszAccountName2 == NULL)
+ return TRUE;
+
+ if (pszAccountName1 == NULL && pszAccountName2 &&
wcscmp(pszAccountName2, L"LocalSystem") == 0)
+ return TRUE;
+
+ if (pszAccountName2 == NULL && pszAccountName1 &&
wcscmp(pszAccountName1, L"LocalSystem") == 0)
+ return TRUE;
+
+ if (pszAccountName1 && pszAccountName2 && wcscmp(pszAccountName1,
pszAccountName2) == 0)
return TRUE;
return FALSE;
@@ -196,9 +202,9 @@
PWSTR ptr;
DWORD dwError = ERROR_SUCCESS;
- DPRINT("ScmLogonService()\n");
-
- DPRINT("Service %S\n", pService->lpServiceName);
+ DPRINT1("ScmLogonService()\n");
+
+ DPRINT1("Service %S\n", pService->lpServiceName);
if (ScmIsLocalSystemAccount(pImage->pszAccountName))
return ERROR_SUCCESS;
@@ -222,10 +228,10 @@
// pDomainName = computer name
}
- DPRINT("Domain: %S User: %S\n", pDomainName, pUserName);
+ DPRINT1("Domain: %S User: %S\n", pDomainName, pUserName);
/* FIXME */
-#if 0
+#if 1
if (!LogonUserW(pUserName,
pDomainName,
L"", // lpszPassword,