oleaut32: Check number of bytes returned by ReadFile.

oldstable
Dmitry Timoshkov 2013-10-29 16:09:22 +09:00 committed by Alexandre Julliard
parent 99a81e1843
commit 724eda257f
1 changed files with 2 additions and 2 deletions

View File

@ -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);