Fix use-after-free

label was freed at menu_entries.c:263, so do comparison first.
This commit is contained in:
Mike Robinson 2014-10-12 02:09:58 +01:00
parent 82d1168622
commit f99f8c7beb
1 changed files with 2 additions and 1 deletions

View File

@ -180,6 +180,7 @@ int menu_entries_push_list(menu_handle_t *menu,
char tmp[PATH_MAX]; char tmp[PATH_MAX];
size_t list_size = 0; size_t list_size = 0;
bool do_action = false; bool do_action = false;
bool is_history_list = !strcmp(label, "history_list");
#if 0 #if 0
RARCH_LOG("Label is: %s\n", label); RARCH_LOG("Label is: %s\n", label);
@ -526,7 +527,7 @@ int menu_entries_push_list(menu_handle_t *menu,
if (do_action) if (do_action)
{ {
driver.menu->scroll_indices_size = 0; driver.menu->scroll_indices_size = 0;
if (strcmp(label, "history_list") != 0) if (is_history_list)
menu_build_scroll_indices(list); menu_build_scroll_indices(list);
entries_refresh(list); entries_refresh(list);