Author: tfaber
Date: Mon Aug 11 12:45:32 2014
New Revision: 63861
URL:
http://svn.reactos.org/svn/reactos?rev=63861&view=rev
Log:
[SYSSETUP]
- Gracefully handle ConvertStringSidToSid failures in InstallBuiltinAccounts and
InstallPrivileges. Fixes invalid frees in second stage.
Modified:
trunk/reactos/dll/win32/syssetup/security.c
Modified: trunk/reactos/dll/win32/syssetup/security.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/securit…
==============================================================================
--- trunk/reactos/dll/win32/syssetup/security.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/syssetup/security.c [iso-8859-1] Mon Aug 11 12:45:32 2014
@@ -170,7 +170,11 @@
for (i = 0; i < 10; i++)
{
- ConvertStringSidToSid(BuiltinAccounts[i], &AccountSid);
+ if (!ConvertStringSidToSid(BuiltinAccounts[i], &AccountSid))
+ {
+ DPRINT1("ConvertStringSidToSid(%S) failed: %lu\n",
BuiltinAccounts[i], GetLastError());
+ continue;
+ }
Status = LsaCreateAccount(PolicyHandle,
AccountSid,
@@ -277,7 +281,11 @@
}
DPRINT("SID: %S\n", szSidString);
- ConvertStringSidToSid(szSidString, &AccountSid);
+ if (!ConvertStringSidToSid(szSidString, &AccountSid))
+ {
+ DPRINT1("ConvertStringSidToSid(%S) failed: %lu\n", szSidString,
GetLastError());
+ continue;
+ }
Status = LsaOpenAccount(PolicyHandle,
AccountSid,