[1/2] comctl32: fix Itemtext in treeview (try 2)

André Hentschel nerv at dawncrow.de
Fri Jan 16 12:22:23 CST 2009


If pointer is Zero we dont send it to strlen.
Without this it runs in a Unhandled page fault on read access to 0x00000000.
Related to Bug #16466

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

diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c
index dd0563a..d784221 100644
--- a/dlls/comctl32/treeview.c
+++ b/dlls/comctl32/treeview.c
@@ -1109,7 +1109,7 @@ TREEVIEW_DoSetItemT(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
 
     TRACE("item %p\n", wineItem);
     /* Do this first in case it fails. */
-    if (tvItem->mask & TVIF_TEXT)
+    if (tvItem->mask & TVIF_TEXT && tvItem->pszText != 0)
     {
         wineItem->textWidth = 0; /* force width recalculation */
 	if (tvItem->pszText != LPSTR_TEXTCALLBACKW) /* covers != TEXTCALLBACKA too */
-- 
1.6.0.4


--------------000302090209060803050208--



More information about the wine-patches mailing list