comctl32: Fix read of uninitialized data in LISTVIEW_GetItemExtT when LVIF_TEXT is not set (Valgrind). (try 2)

Alexander Scott-Johns alexander.scott.johns at googlemail.com
Sat Feb 19 09:48:53 CST 2011


Try 2: Simplify -- just add a mask check before the pointer
comparison, as suggested by Nikolay Sivov.
-------------- next part --------------
From a980ab40f3c8ff40163220488d84c04b2aca27e9 Mon Sep 17 00:00:00 2001
From: Alexander Scott-Johns <alexander.scott.johns at googlemail.com>
Date: Fri, 18 Feb 2011 13:42:56 +0000
Subject: [PATCH] comctl32: Fix read of uninitialized data in LISTVIEW_GetItemExtT when LVIF_TEXT is not set (Valgrind).

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

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index dc96200..4dad175 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -6743,7 +6743,7 @@ static BOOL LISTVIEW_GetItemExtT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVIte
 
     pszText = lpLVItem->pszText;
     bResult = LISTVIEW_GetItemT(infoPtr, lpLVItem, isW);
-    if (bResult && lpLVItem->pszText != pszText)
+    if (bResult && (lpLVItem->mask & LVIF_TEXT) && lpLVItem->pszText != pszText)
     {
 	if (lpLVItem->pszText != LPSTR_TEXTCALLBACKW)
 	    textcpynT(pszText, isW, lpLVItem->pszText, isW, lpLVItem->cchTextMax);
-- 
1.7.0.4


More information about the wine-patches mailing list