comctl32/toolbar: Handle NULL string pointer from TBN_GETINFOTIPW.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
stable
Nikolay Sivov 2019-11-28 10:14:39 +03:00 committed by Alexandre Julliard
parent 27eee2d9ac
commit ae3b334695
2 changed files with 5 additions and 1 deletions

View File

@ -159,6 +159,7 @@ static LRESULT parent_wnd_notify(LPARAM lParam)
break;
case TBN_GETINFOTIPA:
case TBN_GETINFOTIPW:
{
NMTBGETINFOTIPA *tbgit = (NMTBGETINFOTIPA*)lParam;
@ -2029,6 +2030,9 @@ static void test_tooltip(void)
g_ResetDispTextPtr = TRUE;
SendMessageA(hToolbar, WM_NOTIFY, 0, (LPARAM)&nmtti);
/* Same for TBN_GETINFOTIPW */
SendMessageA(hToolbar, TB_SETUNICODEFORMAT, TRUE, 0);
SendMessageA(hToolbar, WM_NOTIFY, 0, (LPARAM)&nmtti);
g_ResetDispTextPtr = FALSE;
DestroyWindow(hToolbar);

View File

@ -6149,7 +6149,7 @@ static LRESULT TOOLBAR_TTGetDispInfo (TOOLBAR_INFO *infoPtr, NMTTDISPINFOW *lpnm
TRACE("TBN_GETINFOTIPW - got string %s\n", debugstr_w(tbgit.pszText));
len = lstrlenW(tbgit.pszText);
len = tbgit.pszText ? lstrlenW(tbgit.pszText) : 0;
if (len > ARRAY_SIZE(lpnmtdi->szText) - 1)
{
/* need to allocate temporary buffer in infoPtr as there