shell32: Don't dereference NULL pointers when tracing.

Francois Gouget fgouget at free.fr
Sun Sep 18 12:37:58 CDT 2011


---

view_params->prcView can very well be NULL.

 dlls/shell32/shlview.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/shell32/shlview.c b/dlls/shell32/shlview.c
index 3f18256..11a9b8f 100644
--- a/dlls/shell32/shlview.c
+++ b/dlls/shell32/shlview.c
@@ -2095,9 +2095,11 @@ static HRESULT WINAPI IShellView2_fnCreateViewWindow2(IShellView2 *iface,
 
     TRACE("-- psvPrev %p, pfs %p, psbOwner %p, prcView %p\n",
             view_params->psvPrev, view_params->pfs, view_params->psbOwner, view_params->prcView);
-    TRACE("-- vmode %#x, flags %#x, left %d, top %d, right %d, bottom %d\n",
-            view_params->pfs->ViewMode, view_params->pfs->fFlags, view_params->prcView->left,
-            view_params->prcView->top, view_params->prcView->right, view_params->prcView->bottom);
+    TRACE("-- vmode %#x, flags %#x", view_params->pfs->ViewMode, view_params->pfs->fFlags);
+    if (view_params->prcView)
+        TRACE(", left %d, top %d, right %d, bottom %d", view_params->prcView->left,
+              view_params->prcView->top, view_params->prcView->right, view_params->prcView->bottom);
+    TRACE("\n");
 
     if (!view_params->psbOwner) return E_UNEXPECTED;
 
-- 
1.7.5.4




More information about the wine-patches mailing list