ole32: Null terminate strings in STREAM_ReadString function.

This commit is contained in:
Piotr Caban 2014-04-07 18:55:11 +02:00 committed by Alexandre Julliard
parent 3ff1c92dd1
commit 306e98425b
1 changed files with 3 additions and 0 deletions

View File

@ -8698,7 +8698,10 @@ static HRESULT STREAM_ReadString( IStream *stm, LPWSTR *string )
len = MultiByteToWideChar( CP_ACP, 0, str, count, NULL, 0 );
wstr = CoTaskMemAlloc( (len + 1)*sizeof (WCHAR) );
if( wstr )
{
MultiByteToWideChar( CP_ACP, 0, str, count, wstr, len );
wstr[len] = 0;
}
CoTaskMemFree( str );
*string = wstr;