diff --git a/reactos/ntoskrnl/se/sid.c b/reactos/ntoskrnl/se/sid.c index 4f8df6afd91..2ccbdf3a3df 100644 --- a/reactos/ntoskrnl/se/sid.c +++ b/reactos/ntoskrnl/se/sid.c @@ -503,9 +503,6 @@ SeCaptureSidAndAttributesArray( } else { - /* First copy the source array */ - RtlCopyMemory(SidAndAttributes, SrcSidAndAttributes, ArraySize); - /* The rest of the data starts after the array */ CurrentDest = (PUCHAR)SidAndAttributes; CurrentDest += ALIGN_UP_BY(ArraySize, sizeof(ULONG)); @@ -517,6 +514,9 @@ SeCaptureSidAndAttributesArray( Sid = SrcSidAndAttributes[i].Sid; SidLength = RtlLengthRequiredSid(Sid->SubAuthorityCount); + /* Copy attributes */ + SidAndAttributes[i].Attributes = SrcSidAndAttributes[i].Attributes; + /* Copy the SID to the current destination address */ SidAndAttributes[i].Sid = (PSID)CurrentDest; RtlCopyMemory(CurrentDest, SrcSidAndAttributes[i].Sid, SidLength);