[PATCH] ole32: check for interface NULL which happens with e.g. Abiword

Marcus Meissner marcus at jet.franken.de
Thu Sep 16 10:12:33 CDT 2010


Hi,

spotted by reporters in #winehackers, via
http://www.abisource.com/downloads/abiword/2.6.8/Windows/abiword-setup-2.6.8.exe

hr is S_OK, but unk is also NULL, lets return E_NOINTERFACE.

Revised a bit more for shortness after Huw and Dmitrys comments.

Ciao, Marcus
---
 dlls/ole32/ole2.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/dlls/ole32/ole2.c b/dlls/ole32/ole2.c
index a9a4885..84bf174 100644
--- a/dlls/ole32/ole2.c
+++ b/dlls/ole32/ole2.c
@@ -450,7 +450,9 @@ HRESULT WINAPI RegisterDragDrop(HWND hwnd, LPDROPTARGET pDropTarget)
   hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
   if(FAILED(hr)) return hr;
 
+  unk = NULL;
   hr = IDropTarget_QueryInterface(pDropTarget, &IID_IUnknown, (void**)&unk);
+  if (SUCCEEDED(hr) && !unk) hr = E_NOINTERFACE;
   if(FAILED(hr))
   {
       IStream_Release(stream);
-- 
1.5.6




More information about the wine-patches mailing list