mirror of
https://github.com/reactos/wine.git
synced 2024-11-24 20:30:01 +00:00
ntdll: Fix heap corruption in RtlDeleteAce.
This commit is contained in:
parent
aea0b5d0f8
commit
0154704f9f
@ -1132,15 +1132,20 @@ NTSTATUS WINAPI RtlDeleteAce(PACL pAcl, DWORD dwAceIndex)
|
||||
PACE_HEADER pcAce;
|
||||
DWORD len = 0;
|
||||
|
||||
/* skip over the ACE we are deleting */
|
||||
pcAce = (PACE_HEADER)(((BYTE*)pAce)+pAce->AceSize);
|
||||
dwAceIndex++;
|
||||
|
||||
/* calculate the length of the rest */
|
||||
for (; dwAceIndex < pAcl->AceCount; dwAceIndex++)
|
||||
{
|
||||
len += pcAce->AceSize;
|
||||
pcAce = (PACE_HEADER)(((BYTE*)pcAce) + pcAce->AceSize);
|
||||
}
|
||||
|
||||
memcpy(pAce, ((BYTE*)pAce)+pAce->AceSize, len);
|
||||
pAcl->AceCount--;
|
||||
/* slide them all backwards */
|
||||
memmove(pAce, ((BYTE*)pAce)+pAce->AceSize, len);
|
||||
pAcl->AceCount--;
|
||||
}
|
||||
|
||||
TRACE("pAcl=%p dwAceIndex=%ld status=0x%08lx\n", pAcl, dwAceIndex, status);
|
||||
|
Loading…
Reference in New Issue
Block a user