Don't tell to MultiByteToWideChar that buffer is bigger than its real size. The size is in characters, not in bytes.

Spotted by Robert Shearman <rob@codeweavers.com>

svn path=/trunk/; revision=18152
This commit is contained in:
Hervé Poussineau 2005-09-29 09:46:35 +00:00
parent b6c1b16e17
commit 06bd1b672d

View file

@ -956,8 +956,7 @@ static struct inf_file *parse_file( HANDLE handle, const WCHAR *class, UINT *err
WCHAR *new_buff = HeapAlloc( GetProcessHeap(), 0, size * sizeof(WCHAR) );
if (new_buff)
{
DWORD len = MultiByteToWideChar( CP_ACP, 0, buffer, size, new_buff,
size * sizeof(WCHAR) );
DWORD len = MultiByteToWideChar( CP_ACP, 0, buffer, size, new_buff, size );
err = parse_buffer( file, new_buff, new_buff + len, error_line );
HeapFree( GetProcessHeap(), 0, new_buff );
}