mirror of
https://github.com/reactos/wine.git
synced 2024-11-29 06:30:37 +00:00
kernel32: Fixed buffer overrun in get_registry_locale_info.
This commit is contained in:
parent
6987a4b453
commit
63ca94c419
@ -804,7 +804,6 @@ static INT get_registry_locale_info( LPCWSTR value, LPWSTR buffer, INT len )
|
||||
}
|
||||
|
||||
status = NtQueryValueKey( hkey, &nameW, KeyValuePartialInformation, info, size, &size );
|
||||
if (status == STATUS_BUFFER_OVERFLOW && !buffer) status = 0;
|
||||
|
||||
if (!status)
|
||||
{
|
||||
@ -825,15 +824,19 @@ static INT get_registry_locale_info( LPCWSTR value, LPWSTR buffer, INT len )
|
||||
buffer[ret-1] = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (status == STATUS_BUFFER_OVERFLOW && !buffer)
|
||||
{
|
||||
if (status == STATUS_OBJECT_NAME_NOT_FOUND) ret = -1;
|
||||
ret = (size - info_size) / sizeof(WCHAR) + 1;
|
||||
}
|
||||
else if (status == STATUS_OBJECT_NAME_NOT_FOUND)
|
||||
{
|
||||
ret = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
SetLastError( RtlNtStatusToDosError(status) );
|
||||
ret = 0;
|
||||
}
|
||||
}
|
||||
NtClose( hkey );
|
||||
HeapFree( GetProcessHeap(), 0, info );
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user