Nikolay Sivov : comctl32/listview: Initialize subitem text buffer before drawing each subitem.

Alexandre Julliard julliard at winehq.org
Tue Apr 12 13:38:05 CDT 2022


Module: wine
Branch: oldstable
Commit: 9002eae344edc547df4f84823e18b99c098854cf
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=9002eae344edc547df4f84823e18b99c098854cf

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Feb 23 13:48:23 2022 +0300

comctl32/listview: Initialize subitem text buffer before drawing each subitem.

Notification handler for LVN_GETDISPINFO is not guaranteed to touch text buffer.
When it doesn't, it can lead to already queried text to be reused for subitems.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52583
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 4f1853c57633629ad81a233ab75a85b6f41399ad)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/comctl32/listview.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 0c80b6164a9..5d591a1de6c 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -4798,6 +4798,7 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, ITERAT
                 lvItem.lParam = 0;
                 lvItem.cchTextMax = DISP_TEXT_SIZE;
                 lvItem.pszText = szDispText;
+                szDispText[0] = 0;
                 if (!LISTVIEW_GetItemW(infoPtr, &lvItem)) return FALSE;
                 if (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT)
 	            lvItem.state = LISTVIEW_GetItemState(infoPtr, nItem, LVIS_SELECTED);




More information about the wine-cvs mailing list