Kirill K. Smirnov : comctl32/treeview: Avoid a NULL pointer dereference.

Alexandre Julliard julliard at winehq.org
Wed Dec 9 10:46:29 CST 2009


Module: wine
Branch: master
Commit: dc45e2c5130a9a95ea6ba456d696d38853b26416
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=dc45e2c5130a9a95ea6ba456d696d38853b26416

Author: Kirill K. Smirnov <lich at math.spbu.ru>
Date:   Wed Dec  9 16:27:45 2009 +0300

comctl32/treeview: Avoid a NULL pointer dereference.

---

 dlls/comctl32/treeview.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

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-cvs mailing list