From dfa74b998ee8729f9129cd72119bf1e36f74fc23 Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Tue, 3 Jan 2006 12:07:49 +0100 Subject: [PATCH] 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. --- dlls/ole32/hglobalstream.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/ole32/hglobalstream.c b/dlls/ole32/hglobalstream.c index ca73a224228..4d1d4b5ebfb 100644 --- a/dlls/ole32/hglobalstream.c +++ b/dlls/ole32/hglobalstream.c @@ -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; + } } /* -- 2.11.4.GIT