ole: Check the return value of IStream_SetSize in IStream_Read.

Check the return value of IStream_SetSize in IStream_Read, since
otherwise execution could continue on and cause heap corruption.
This commit is contained in:
Robert Shearman 2006-01-03 12:07:49 +01:00 committed by Alexandre Julliard
parent 8f604e925d
commit dfa74b998e
1 changed files with 6 additions and 1 deletions

View File

@ -313,7 +313,12 @@ static HRESULT WINAPI HGLOBALStreamImpl_Write(
if (newSize.u.LowPart > This->streamSize.u.LowPart)
{
/* grow stream */
IStream_SetSize(iface, newSize);
HRESULT hr = IStream_SetSize(iface, newSize);
if (FAILED(hr))
{
ERR("IStream_SetSize failed with error 0x%08lx\n", hr);
return hr;
}
}
/*