Author: rmessiant
Date: Thu Dec 23 15:38:14 2010
New Revision: 50114
URL:
http://svn.reactos.org/svn/reactos?rev=50114&view=rev
Log:
[SHELL32]
- Add NULL checks in IShellView and IDropTarget implementations. Should fix bug #5780.
Modified:
trunk/reactos/dll/win32/shell32/shlview.c
Modified: trunk/reactos/dll/win32/shell32/shlview.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlview.…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shlview.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shlview.c [iso-8859-1] Thu Dec 23 15:38:14 2010
@@ -2072,7 +2072,14 @@
TRACE("(%p)->(shlview=%p set=%p shlbrs=%p rec=%p hwnd=%p)
incomplete\n",This, lpPrevView,lpfs, psb, prcView, phWnd);
- TRACE("-- vmode=%x flags=%x left=%i top=%i right=%i
bottom=%i\n",lpfs->ViewMode, lpfs->fFlags ,prcView->left,prcView->top,
prcView->right, prcView->bottom);
+ if (lpfs != NULL)
+ TRACE("-- vmode=%x flags=%x\n", lpfs->ViewMode, lpfs->fFlags);
+ if (prcView != NULL)
+ TRACE("-- left=%i top=%i right=%i bottom=%i\n", prcView->left,
prcView->top, prcView->right, prcView->bottom);
+
+ /* Validate the Shell Browser */
+ if (psb == NULL)
+ return E_UNEXPECTED;
/*set up the member variables*/
This->pShellBrowser = psb;
@@ -2534,8 +2541,13 @@
IDropTarget_Release(This->pCurDropTarget);
This->pCurDropTarget = NULL;
}
- IDataObject_Release(This->pCurDataObject);
- This->pCurDataObject = NULL;
+
+ if (This->pCurDataObject != NULL)
+ {
+ IDataObject_Release(This->pCurDataObject);
+ This->pCurDataObject = NULL;
+ }
+
This->iDragOverItem = 0;
return S_OK;
@@ -2553,8 +2565,12 @@
This->pCurDropTarget = NULL;
}
- IDataObject_Release(This->pCurDataObject);
- This->pCurDataObject = NULL;
+ if (This->pCurDataObject != NULL)
+ {
+ IDataObject_Release(This->pCurDataObject);
+ This->pCurDataObject = NULL;
+ }
+
This->iDragOverItem = 0;
return S_OK;