summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonb <simonb>2005-05-06 15:22:24 (GMT)
committersimonb <simonb>2005-05-06 15:22:24 (GMT)
commit90fcc93d6e87183c7d2956b4b1e067be25060169 (patch)
tree2e0a6a22054452c2ea32c8d250b4a32613797feb
parentd6ee96775dfdf0ee8bb2f00537f11a335c9b5a18 (diff)
downloadfluxbox_lack-90fcc93d6e87183c7d2956b4b1e067be25060169.zip
fluxbox_lack-90fcc93d6e87183c7d2956b4b1e067be25060169.tar.bz2
fix segfault opportunity in menu
-rw-r--r--ChangeLog2
-rw-r--r--src/FbTk/Menu.cc5
2 files changed, 7 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index a9198ca..7d70594 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
1(Format: Year/Month/Day) 1(Format: Year/Month/Day)
2Changes for 0.9.13 2Changes for 0.9.13
3*05/05/06: 3*05/05/06:
4 * Fix potential segfault menu bug, thanks chenfeng (Simon)
5 Menu.cc
4 * Added more KeyActions to TextBox (thanx to Vadim <suhanov_vadim@mail.ru> 6 * Added more KeyActions to TextBox (thanx to Vadim <suhanov_vadim@mail.ru>
5 Control + LeftArrow -> Moves cursor to the left direction, up to next word. 7 Control + LeftArrow -> Moves cursor to the left direction, up to next word.
6 Control + RightArrow -> to the right direction. 8 Control + RightArrow -> to the right direction.
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc
index e0e3e7f..e05f531 100644
--- a/src/FbTk/Menu.cc
+++ b/src/FbTk/Menu.cc
@@ -273,6 +273,9 @@ void Menu::lower() {
273} 273}
274 274
275void Menu::nextItem() { 275void Menu::nextItem() {
276 if (menuitems.empty())
277 return;
278
276 int old_which_press = m_which_press; 279 int old_which_press = m_which_press;
277 m_active_index = -1; 280 m_active_index = -1;
278 if (validIndex(old_which_press) && 281 if (validIndex(old_which_press) &&
@@ -308,6 +311,8 @@ void Menu::nextItem() {
308} 311}
309 312
310void Menu::prevItem() { 313void Menu::prevItem() {
314 if (menuitems.empty())
315 return;
311 316
312 int old_which_press = m_which_press; 317 int old_which_press = m_which_press;
313 m_active_index = -1; 318 m_active_index = -1;