mirror of
https://github.com/Cloudef/bemenu
synced 2025-02-23 10:26:49 +00:00
Do bounds checking correctly.
This commit is contained in:
parent
944e36b21d
commit
dd4bddcf98
@ -272,7 +272,7 @@ bmItem* bmMenuGetSelectedItem(const bmMenu *menu)
|
||||
unsigned int count;
|
||||
bmItem **items = bmMenuGetFilteredItems(menu, &count);
|
||||
|
||||
if (!items || count < menu->index)
|
||||
if (!items || count <= menu->index)
|
||||
return NULL;
|
||||
|
||||
return items[menu->index];
|
||||
|
Loading…
Reference in New Issue
Block a user