- Round up requested amount of memory instead of down

- Simplify space check, old version didn't work because of signed/unsigned issues

svn path=/trunk/; revision=11045
This commit is contained in:
Gé van Geldorp 2004-09-25 08:58:44 +00:00
parent 79c3ba475a
commit 95210d36ee

View file

@ -133,8 +133,7 @@ RtlpAddKnownAce (PACL Acl,
{ {
return(STATUS_ALLOTTED_SPACE_EXCEEDED); return(STATUS_ALLOTTED_SPACE_EXCEEDED);
} }
if (((PVOID)Ace + RtlLengthSid(Sid) + sizeof(ACE)) >= if (RtlLengthSid(Sid) + sizeof(ACE) > Acl->AclSize)
((PVOID)Acl + Acl->AclSize))
{ {
return(STATUS_ALLOTTED_SPACE_EXCEEDED); return(STATUS_ALLOTTED_SPACE_EXCEEDED);
} }
@ -551,7 +550,7 @@ RtlCreateAcl(PACL Acl,
return(STATUS_INVALID_PARAMETER); return(STATUS_INVALID_PARAMETER);
} }
AclSize = AclSize & ~(0x3); AclSize = (AclSize + 3) & ~(0x3);
Acl->AclSize = AclSize; Acl->AclSize = AclSize;
Acl->AclRevision = AclRevision; Acl->AclRevision = AclRevision;
Acl->AceCount = 0; Acl->AceCount = 0;