From 576ec9bdc46890ca2d379452573ccc151ddcd130 Mon Sep 17 00:00:00 2001 From: Duna Oh Date: Fri, 9 Jan 2015 14:51:40 +0900 Subject: [PATCH] fix crash when activating menu that is not in range Summary: add the condition check code if the pressed key is not in range of menu items Test Plan: (1) Left-click on the desktop to bring up the menu. (2) Press down the number key to activate the menu item. (3) When you press down the number key that is not in range, you will see the segmentation error. below is the crash log which I encoutered. ------------------------------------------------------------------- Program received signal SIGSEGV, Segmentation fault. _e_menu_item_activate_nth (n=n@entry=5) at src/bin/e_menu.c:2318 2318 _e_menu_item_ensure_onscreen(mi); Reviewers: zmike, gwanglim, raster Reviewed By: raster Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1845 --- src/bin/e_menu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bin/e_menu.c b/src/bin/e_menu.c index 0d4526cc0..4fdf76700 100644 --- a/src/bin/e_menu.c +++ b/src/bin/e_menu.c @@ -2211,6 +2211,7 @@ _e_menu_item_activate_nth(int n) if (!mi->separator) i++; if (i == n) break; } + if (!mi) return; e_menu_item_active_set(mi, 1); _e_menu_item_ensure_onscreen(mi); }