diff --git a/dlls/ntdll/sec.c b/dlls/ntdll/sec.c index ba8d7b71593..20adc044158 100644 --- a/dlls/ntdll/sec.c +++ b/dlls/ntdll/sec.c @@ -1149,9 +1149,8 @@ BOOLEAN WINAPI RtlFirstFreeAce( return FALSE; ace = (PACE_HEADER)(((BYTE*)ace)+ace->AceSize); } - if ((BYTE *)ace >= (BYTE *)acl + acl->AclSize) - return FALSE; - *x = ace; + if ((BYTE *)ace <= (BYTE *)acl + acl->AclSize) + *x = ace; return TRUE; }