Skip to content

Commit f17d904

Browse files
authored
[WIN32SS:NTUSER] Return NO_SELECTED_ITEM from NtUserMenuItemFromPoint() when no item is hit (reactos#9121)
Fix the bug, where `NtUserMenuItemFromPoint()` returned `cItems` instead of `NO_SELECTED_ITEM` when no item is under the point (`mi` is never NULL on a miss), so `MenuItemFromPoint()` callers could have indexed one past the menu array.
1 parent ae0e4ee commit f17d904

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎win32ss/user/ntuser/menu.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6348,7 +6348,7 @@ NtUserMenuItemFromPoint(
63486348
}
63496349
}
63506350

6351-
Ret = (mi ? i : NO_SELECTED_ITEM);
6351+
Ret = (i < Menu->cItems ? i : NO_SELECTED_ITEM);
63526352

63536353
Exit:
63546354
UserLeave();

0 commit comments

Comments
 (0)