Piotr Caban : ole32: Null terminate strings in STREAM_ReadString function.

Alexandre Julliard julliard at winehq.org
Mon Apr 7 13:20:08 CDT 2014


Module: wine
Branch: master
Commit: 306e98425bb7b36c63a1c1d452cf28953512359e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=306e98425bb7b36c63a1c1d452cf28953512359e

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Mon Apr  7 18:55:11 2014 +0200

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 debdbbf..b859ad1 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;




More information about the wine-cvs mailing list