comctl32/treeview: Avoid a NULL pointer dereference

Kirill K. Smirnov lich at math.spbu.ru
Wed Dec 9 07:27:45 CST 2009


-------------- next part --------------
diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c
index 7cabef6..8752f86 100644
--- a/dlls/comctl32/treeview.c
+++ b/dlls/comctl32/treeview.c
@@ -4091,7 +4091,8 @@ TREEVIEW_LButtonDown(TREEVIEW_INFO *infoPtr, LPARAM lParam)
                 InvalidateRect(infoPtr->hwnd, &tempItem->rect, TRUE);
 
                 /* refresh the selected item to return the filled background */
-                InvalidateRect(infoPtr->hwnd, &(infoPtr->selectedItem->rect), TRUE);
+                if (infoPtr->selectedItem)
+                    InvalidateRect(infoPtr->hwnd, &(infoPtr->selectedItem->rect), TRUE);
             }
 
 	    return 0;


More information about the wine-patches mailing list