From 78db5f0d71707309243a3b10011137959028d8ca Mon Sep 17 00:00:00 2001 From: Michael Martin Date: Sun, 18 Apr 2010 12:06:29 +0000 Subject: [PATCH] [NTMARTA] - AccRewriteSetEntriesInAcl: Fix a bug that caused the for loop never to complete due to reuse of same variable. svn path=/trunk/; revision=46916 --- reactos/dll/win32/ntmarta/ntmarta.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/reactos/dll/win32/ntmarta/ntmarta.c b/reactos/dll/win32/ntmarta/ntmarta.c index e077b0570be..f6e77d4cbef 100644 --- a/reactos/dll/win32/ntmarta/ntmarta.c +++ b/reactos/dll/win32/ntmarta/ntmarta.c @@ -1236,7 +1236,7 @@ AccRewriteSetEntriesInAcl(ULONG cCountOfExplicitEntries, DWORD ObjectsPresent; BOOL needToClean; PSID pSid1, pSid2; - ULONG i; + ULONG i, j; LSA_HANDLE PolicyHandle = NULL; BOOL bRet; DWORD LastErr; @@ -1295,11 +1295,11 @@ AccRewriteSetEntriesInAcl(ULONG cCountOfExplicitEntries, case REVOKE_ACCESS: case SET_ACCESS: /* Discard all accesses for the trustee... */ - for (i = 0; i < SizeInformation.AceCount; i++) + for (j = 0; j < SizeInformation.AceCount; j++) { - if (!pKeepAce[i]) + if (!pKeepAce[j]) continue; - if (!GetAce(OldAcl, i, (PVOID*)&pAce)) + if (!GetAce(OldAcl, j, (PVOID*)&pAce)) { Ret = GetLastError(); goto Cleanup; @@ -1308,7 +1308,7 @@ AccRewriteSetEntriesInAcl(ULONG cCountOfExplicitEntries, pSid2 = AccpGetAceSid(pAce); if (RtlEqualSid(pSid1, pSid2)) { - pKeepAce[i] = FALSE; + pKeepAce[j] = FALSE; SizeInformation.AclBytesInUse -= pAce->AceSize; } } -- 2.17.1