Dmitry Timoshkov : oleaut32: Check number of bytes returned by ReadFile.
Alexandre Julliard
julliard at winehq.org
Wed Oct 30 13:11:04 CDT 2013
Module: wine
Branch: master
Commit: 724eda257f9f5fcaf1fcbb4d89ffc8ad56472068
URL: http://source.winehq.org/git/wine.git/?a=commit;h=724eda257f9f5fcaf1fcbb4d89ffc8ad56472068
Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date: Tue Oct 29 16:09:22 2013 +0900
oleaut32: Check number of bytes returned by ReadFile.
---
dlls/oleaut32/olepicture.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c
index 4b3e9dd..2772a2f 100644
--- a/dlls/oleaut32/olepicture.c
+++ b/dlls/oleaut32/olepicture.c
@@ -2273,7 +2273,7 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller,
HANDLE hFile;
DWORD dwFileSize;
HGLOBAL hGlobal = NULL;
- DWORD dwBytesRead = 0;
+ DWORD dwBytesRead;
IStream *stream;
BOOL bRead;
IPersistStream *pStream;
@@ -2317,7 +2317,7 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller,
hGlobal = GlobalAlloc(GMEM_FIXED,dwFileSize);
if ( hGlobal)
{
- bRead = ReadFile(hFile, hGlobal, dwFileSize, &dwBytesRead, NULL);
+ bRead = ReadFile(hFile, hGlobal, dwFileSize, &dwBytesRead, NULL) && dwBytesRead == dwFileSize;
if (!bRead)
{
GlobalFree(hGlobal);
More information about the wine-cvs
mailing list