advapi32: Fix Unicode string lengths in LsaLookupSids.

Found by Louis Lenders.
This commit is contained in:
Alexandre Julliard 2010-06-09 20:52:13 +02:00
parent 950919ee33
commit ffb29fd335
1 changed files with 3 additions and 3 deletions

View File

@ -491,9 +491,9 @@ NTSTATUS WINAPI LsaLookupSids(
if (domain_size)
{
domain.Length = domain_size*sizeof(WCHAR);
domain.Length = (domain_size - 1) * sizeof(WCHAR);
domain.MaximumLength = domain_size*sizeof(WCHAR);
domain.Buffer = HeapAlloc(GetProcessHeap(),0,domain.Length);
domain.Buffer = HeapAlloc(GetProcessHeap(),0,domain.MaximumLength);
}
else
{
@ -503,7 +503,7 @@ NTSTATUS WINAPI LsaLookupSids(
}
(*Names)[i].Use = use;
(*Names)[i].Name.Length = name_size * sizeof(WCHAR);
(*Names)[i].Name.Length = (name_size - 1) * sizeof(WCHAR);
(*Names)[i].Name.MaximumLength = name_size * sizeof(WCHAR);
(*Names)[i].Name.Buffer = HeapAlloc(GetProcessHeap(),0,name_size * sizeof(WCHAR));
LookupAccountSidW(NULL, Sids[i], (*Names)[i].Name.Buffer, &name_size, domain.Buffer, &domain_size, &use);