mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 09:25:01 +00:00
Fix out-of-bounds access in MenuPopup
This commit is contained in:
parent
1b47784b2a
commit
0e4d4c5fbb
@ -259,7 +259,9 @@ impl MenuPopup {
|
||||
if let Some(position) = position.checked_sub(offset) {
|
||||
// Now `position` is relative to the top-left of the content.
|
||||
let focus = position.y;
|
||||
if !self.menu.children[focus].is_delimiter() {
|
||||
if focus < self.menu.len()
|
||||
&& !self.menu.children[focus].is_delimiter()
|
||||
{
|
||||
self.focus = focus;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user