Nikolay Sivov : comctl32/toolbar: Handle NULL string pointer from TBN_GETINFOTIPW.

Alexandre Julliard julliard at winehq.org
Thu Nov 28 16:02:20 CST 2019


Module: wine
Branch: master
Commit: ae3b334695e4df1c22bb338dfe105970811ed11d
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=ae3b334695e4df1c22bb338dfe105970811ed11d

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Thu Nov 28 10:14:39 2019 +0300

comctl32/toolbar: Handle NULL string pointer from TBN_GETINFOTIPW.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/comctl32/tests/toolbar.c | 4 ++++
 dlls/comctl32/toolbar.c       | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/dlls/comctl32/tests/toolbar.c b/dlls/comctl32/tests/toolbar.c
index 41807258f4..3688394d71 100644
--- a/dlls/comctl32/tests/toolbar.c
+++ b/dlls/comctl32/tests/toolbar.c
@@ -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);
diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c
index ceab5328bc..c302e6c111 100644
--- a/dlls/comctl32/toolbar.c
+++ b/dlls/comctl32/toolbar.c
@@ -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




More information about the wine-cvs mailing list