comctl32/tab: Check destination pointer for NULL in TCM_GETITEM handler.

This commit is contained in:
Nikolay Sivov 2009-08-14 22:50:05 +04:00 committed by Alexandre Julliard
parent 4c9405a83c
commit 031c497a5a
2 changed files with 7 additions and 0 deletions

View File

@ -2810,6 +2810,8 @@ TAB_GetItemT (TAB_INFO *infoPtr, INT iItem, LPTCITEMW tabItem, BOOL bUnicode)
TRACE("(%p,%d,%p,%s)\n", infoPtr, iItem, tabItem, bUnicode ? "true" : "false");
if (!tabItem) return FALSE;
if (iItem < 0 || iItem >= infoPtr->uNumItem)
return FALSE;

View File

@ -835,8 +835,13 @@ static void test_getters_setters(HWND parent_wnd, INT nTabs)
/* Testing GetSet Item */
{
TCITEM tcItem;
DWORD ret;
char szText[32] = "New Label";
/* TCM_GETITEM with null dest pointer */
ret = SendMessage(hTab, TCM_GETITEM, 0, (LPARAM)NULL);
expect(FALSE, ret);
flush_sequences(sequences, NUM_MSG_SEQUENCES);
tcItem.mask = TCIF_TEXT;