elm_toolbar.c: check reorder_from at the start of _items_change. reorder_from is used here and there.

this fixes dereference before null issue which was spotted by coverity. CID 1039999.
This commit is contained in:
Daniel Juyung Seo 2013-07-06 12:26:59 +09:00
parent 2d8238b9f2
commit 7bbcf8a271
1 changed files with 2 additions and 1 deletions

View File

@ -1489,10 +1489,11 @@ _items_change(Elm_Toolbar_Item *reorder_from, Elm_Toolbar_Item *reorder_to)
Elm_Toolbar_Item *prev = NULL, *next = NULL;
int tmp;
if (!reorder_from) return;
ELM_TOOLBAR_DATA_GET(WIDGET(reorder_from), sd);
if (reorder_from == reorder_to) return;
if ((reorder_from) && (reorder_to) &&
if ((reorder_to) &&
(!reorder_from->separator) && (!reorder_to->separator))
{
prev = ELM_TOOLBAR_ITEM_FROM_INLIST