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(a)codeweavers.com>
Modified: trunk/reactos/lib/setupapi/parser.c
_____
Modified: trunk/reactos/lib/setupapi/parser.c
--- trunk/reactos/lib/setupapi/parser.c 2005-09-29 03:39:38 UTC (rev
18151)
+++ trunk/reactos/lib/setupapi/parser.c 2005-09-29 09:46:35 UTC (rev
18152)
@@ -956,8 +956,7 @@
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 );
}