diff options
author | Jari Vetoniemi <mailroxas@gmail.com> | 2014-04-10 01:25:46 +0300 |
---|---|---|
committer | Jari Vetoniemi <mailroxas@gmail.com> | 2014-04-10 01:25:46 +0300 |
commit | dd4bddcf9877c5cf2f01cc035417f779565a0267 (patch) | |
tree | 8d6155a7b5e7aeb4d48d55e0914f635ca64333cc | |
parent | 944e36b21d1bbc80680e228daa75f27b3eab4e4b (diff) | |
download | bemenu-dd4bddcf9877c5cf2f01cc035417f779565a0267.tar.gz bemenu-dd4bddcf9877c5cf2f01cc035417f779565a0267.tar.bz2 bemenu-dd4bddcf9877c5cf2f01cc035417f779565a0267.zip |
Do bounds checking correctly.
-rw-r--r-- | lib/menu.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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]; |