[ADVAPI32] Fix crash when running advapi32:security with DPH.

Import the following Wine commits:
* 79636bebbfa Michael Müller: advapi32: Set last error to ERROR_SUCCESS in GetSidIdentifierAuthority.
* 1d03ba76116 Hans Leidekker: advapi32: Fix parsing empty DACL/SACL security descriptor strings.
* 5bc2e83c7ab Hans Leidekker: advapi32: Fix size returned from ConvertStringSecurityDescriptorToSecurityDescriptor on 64-bit.
This commit is contained in:
Thomas Faber 2018-06-10 15:45:57 +02:00
parent 05b4bd3833
commit 95c3e17a80
No known key found for this signature in database
GPG key ID: 076E7C3D44720826

View file

@ -759,6 +759,7 @@ PSID_IDENTIFIER_AUTHORITY
WINAPI
GetSidIdentifierAuthority(PSID pSid)
{
SetLastError(ERROR_SUCCESS);
return RtlIdentifierAuthoritySid(pSid);
}
@ -2227,7 +2228,7 @@ static DWORD ParseAclStringFlags(LPCWSTR* StringAcl)
DWORD flags = 0;
LPCWSTR szAcl = *StringAcl;
while (*szAcl != '(')
while (*szAcl && *szAcl != '(')
{
if (*szAcl == 'P')
{
@ -2538,7 +2539,7 @@ static BOOL ParseStringAclToAcl(LPCWSTR StringAcl, LPDWORD lpdwFlags,
pAcl->AclRevision = ACL_REVISION;
pAcl->Sbz1 = 0;
pAcl->AclSize = length;
pAcl->AceCount = acecount++;
pAcl->AceCount = acecount;
pAcl->Sbz2 = 0;
}
return TRUE;
@ -2549,7 +2550,6 @@ lerr:
return FALSE;
}
/******************************************************************************
* ParseStringSecurityDescriptorToSecurityDescriptor
*/
@ -2565,7 +2565,7 @@ static BOOL ParseStringSecurityDescriptorToSecurityDescriptor(
LPBYTE lpNext = NULL;
DWORD len;
*cBytes = sizeof(SECURITY_DESCRIPTOR);
*cBytes = sizeof(SECURITY_DESCRIPTOR_RELATIVE);
tok = heap_alloc( (lstrlenW(StringSecurityDescriptor) + 1) * sizeof(WCHAR));