From 306e98425bb7b36c63a1c1d452cf28953512359e Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Mon, 7 Apr 2014 18:55:11 +0200 Subject: [PATCH] ole32: Null terminate strings in STREAM_ReadString function. --- dlls/ole32/storage32.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index debdbbf3ccd..b859ad151c9 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -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;