mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[WIN32SS:NTUSER] Return NO_SELECTED_ITEM from NtUserMenuItemFromPoint() when no item is hit (#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.
This commit is contained in:
@@ -6348,7 +6348,7 @@ NtUserMenuItemFromPoint(
|
||||
}
|
||||
}
|
||||
|
||||
Ret = (mi ? i : NO_SELECTED_ITEM);
|
||||
Ret = (i < Menu->cItems ? i : NO_SELECTED_ITEM);
|
||||
|
||||
Exit:
|
||||
UserLeave();
|
||||
|
||||
Reference in New Issue
Block a user