Commit 724eda25 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

oleaut32: Check number of bytes returned by ReadFile.

parent 99a81e18
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment