advapi32: Fix the initialization of combined DACLs when the new DACL is empty.

Wine-Bug:  https://bugs.winehq.org/show_bug.cgi?id=38423
Signed-off-by: Vijay Kiran Kamuju <infyquest@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Erich E. Hoover 2019-04-25 11:36:15 +02:00 committed by Alexandre Julliard
parent 9aac7ca191
commit 92ee3543e5
1 changed files with 18 additions and 2 deletions

View File

@ -5966,6 +5966,7 @@ BOOL WINAPI FileEncryptionStatusA(LPCSTR lpFileName, LPDWORD lpStatus)
static NTSTATUS combine_dacls(ACL *parent, ACL *child, ACL **result)
{
NTSTATUS status;
ACL *combined;
int i;
@ -5974,8 +5975,23 @@ static NTSTATUS combine_dacls(ACL *parent, ACL *child, ACL **result)
if (!combined)
return STATUS_NO_MEMORY;
memcpy(combined, child, child->AclSize);
combined->AclSize = child->AclSize+parent->AclSize;
status = RtlCreateAcl(combined, parent->AclSize+child->AclSize, ACL_REVISION);
if (status != STATUS_SUCCESS)
{
heap_free(combined);
return status;
}
/* copy the new ACEs */
for (i=0; i<child->AceCount; i++)
{
ACE_HEADER *ace;
if (!GetAce(child, i, (void*)&ace))
continue;
if (!AddAce(combined, ACL_REVISION, MAXDWORD, ace, ace->AceSize))
WARN("error adding new ACE\n");
}
/* copy the inherited ACEs */
for (i=0; i<parent->AceCount; i++)