mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[NETAPI32]
NetLocalGroupGetMembers: Fix heap corruption by calculationg the proper buffer size. svn path=/trunk/; revision=60119
This commit is contained in:
parent
b6535e2e4b
commit
6e5bdff3a6
1 changed files with 12 additions and 12 deletions
|
@ -1515,27 +1515,27 @@ NetLocalGroupGetMembers(
|
|||
switch (level)
|
||||
{
|
||||
case 0:
|
||||
Size = sizeof(LOCALGROUP_MEMBERS_INFO_0) +
|
||||
RtlLengthSid(EnumContext->Sids[i]);
|
||||
Size += sizeof(LOCALGROUP_MEMBERS_INFO_0) +
|
||||
RtlLengthSid(EnumContext->Sids[i]);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
Size = sizeof(LOCALGROUP_MEMBERS_INFO_1) +
|
||||
RtlLengthSid(EnumContext->Sids[i]) +
|
||||
EnumContext->Names[i].Name.Length + sizeof(WCHAR);
|
||||
Size += sizeof(LOCALGROUP_MEMBERS_INFO_1) +
|
||||
RtlLengthSid(EnumContext->Sids[i]) +
|
||||
EnumContext->Names[i].Name.Length + sizeof(WCHAR);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
Size = sizeof(LOCALGROUP_MEMBERS_INFO_2) +
|
||||
RtlLengthSid(EnumContext->Sids[i]) +
|
||||
EnumContext->Names[i].Name.Length + sizeof(WCHAR) +
|
||||
EnumContext->Domains->Domains[EnumContext->Names[i].DomainIndex].Name.Length + sizeof(WCHAR);
|
||||
Size += sizeof(LOCALGROUP_MEMBERS_INFO_2) +
|
||||
RtlLengthSid(EnumContext->Sids[i]) +
|
||||
EnumContext->Names[i].Name.Length + sizeof(WCHAR) +
|
||||
EnumContext->Domains->Domains[EnumContext->Names[i].DomainIndex].Name.Length + sizeof(WCHAR);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
Size = sizeof(LOCALGROUP_MEMBERS_INFO_3) +
|
||||
EnumContext->Names[i].Name.Length + sizeof(WCHAR) +
|
||||
EnumContext->Domains->Domains[EnumContext->Names[i].DomainIndex].Name.Length + sizeof(WCHAR);
|
||||
Size += sizeof(LOCALGROUP_MEMBERS_INFO_3) +
|
||||
EnumContext->Names[i].Name.Length + sizeof(WCHAR) +
|
||||
EnumContext->Domains->Domains[EnumContext->Names[i].DomainIndex].Name.Length + sizeof(WCHAR);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue