From 4fcde9a3c9789eef5a6870b3a42bef284ecbda07 Mon Sep 17 00:00:00 2001 From: Damjan Jovanovic Date: Tue, 26 Nov 2019 18:08:22 +0200 Subject: [PATCH] comctl32: Allocate the right wstr size for the TVN_GETDISPINFOW reply. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=25264 Signed-off-by: Damjan Jovanovic Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard (cherry picked from commit d558896fff1df9b595cb1d74ce387852c8a4eaab) Signed-off-by: Michael Stefaniuc --- dlls/comctl32/treeview.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index 85a963ddc18..07df66566ad 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -758,7 +758,7 @@ TREEVIEW_UpdateDispInfo(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item, else { int len = max(lstrlenW(callback.item.pszText) + 1, TEXT_CALLBACK_SIZE); - LPWSTR newText = heap_realloc(item->pszText, len); + LPWSTR newText = heap_realloc(item->pszText, len*sizeof(WCHAR)); TRACE("returned wstr %s, len=%d\n", debugstr_w(callback.item.pszText), len);