ntdll: Use correct output buffer size in RtlpNtEnumerateSubKey.
Signed-off-by: Torge Matthies <tmatthies@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
fd5c680abe
commit
cf7cb993b8
|
@ -91,9 +91,9 @@ NTSTATUS WINAPI RtlpNtEnumerateSubKey( HANDLE handle, UNICODE_STRING *out, ULONG
|
||||||
DWORD dwLen, dwResultLen;
|
DWORD dwLen, dwResultLen;
|
||||||
NTSTATUS ret;
|
NTSTATUS ret;
|
||||||
|
|
||||||
if (out->Length)
|
if (out->MaximumLength)
|
||||||
{
|
{
|
||||||
dwLen = out->Length + sizeof(KEY_BASIC_INFORMATION);
|
dwLen = out->MaximumLength + sizeof(KEY_BASIC_INFORMATION);
|
||||||
info = RtlAllocateHeap( GetProcessHeap(), 0, dwLen );
|
info = RtlAllocateHeap( GetProcessHeap(), 0, dwLen );
|
||||||
if (!info)
|
if (!info)
|
||||||
return STATUS_NO_MEMORY;
|
return STATUS_NO_MEMORY;
|
||||||
|
@ -111,7 +111,7 @@ NTSTATUS WINAPI RtlpNtEnumerateSubKey( HANDLE handle, UNICODE_STRING *out, ULONG
|
||||||
out->Length = dwResultLen;
|
out->Length = dwResultLen;
|
||||||
else if (!ret)
|
else if (!ret)
|
||||||
{
|
{
|
||||||
if (out->Length < info->NameLength)
|
if (out->MaximumLength < info->NameLength)
|
||||||
{
|
{
|
||||||
out->Length = dwResultLen;
|
out->Length = dwResultLen;
|
||||||
ret = STATUS_BUFFER_OVERFLOW;
|
ret = STATUS_BUFFER_OVERFLOW;
|
||||||
|
|
Loading…
Reference in New Issue