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

Nikolay Sivov nsivov at codeweavers.com
Wed Feb 23 04:48:23 CST 2022


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>
---
 dlls/comctl32/listview.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 2cb96367551..730bf4aaddd 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -4800,6 +4800,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);
-- 
2.34.1




More information about the wine-devel mailing list