When looking into sys menu, check if items are present before

dereferencing.
This commit is contained in:
Eric Pouech 1999-06-05 11:43:50 +00:00 committed by Alexandre Julliard
parent 153334e50a
commit dfed208e90
1 changed files with 1 additions and 1 deletions

View File

@ -3766,7 +3766,7 @@ HMENU WINAPI GetSystemMenu( HWND hWnd, BOOL bRevert )
{
POPUPMENU *menu = (POPUPMENU*)
USER_HEAP_LIN_ADDR(wndPtr->hSysMenu);
if( menu->items[0].hSubMenu == MENU_DefSysPopup )
if( menu->nItems > 0 && menu->items[0].hSubMenu == MENU_DefSysPopup )
menu->items[0].hSubMenu = MENU_CopySysPopup();
}
}