toolbar: Fix crash on more_item when shrink mode is set with no item.
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Mon, 12 Oct 2015 07:46:36 +0000 (16:46 +0900)
committerJaehyun Cho <jae_hyun.cho@samsung.com>
Mon, 12 Oct 2015 07:53:51 +0000 (16:53 +0900)
Toolbar creates a more_item when shrink mode is
ELM_TOOLBAR_SHRINK_EXPAND.
If select mode is ELM_OBJECT_SELECT_MODE_ALWAYS and there is no item
appended, then toolbar sets a selection on a newly created item.
In this case, sd->more_item is referenced before the new more_item is
assigned to sd->more_item.

@fix

src/lib/elm_toolbar.c

index aa39481836427099013c8f06e1261005936ff7fd..df2ab9043d9d03f9b79e2d123a9af83374189b82 100644 (file)
@@ -1077,6 +1077,8 @@ _item_select(Elm_Toolbar_Item_Data *it)
 
    if (eo_do_ret(EO_OBJ(it), tmp, elm_wdg_item_disabled_get()) || (it->separator) || (it->object))
      return;
+   if ((sd->shrink_mode == ELM_TOOLBAR_SHRINK_EXPAND) && (!sd->more_item))
+     return;
    sel = it->selected;
 
    if ((sd->select_mode != ELM_OBJECT_SELECT_MODE_NONE) &&