elementary/index - [E-devel] [PATCH] elm_index : set it->letter to NULL after eina_stringshare_del

Hello all,

In elm_index.c, _item_del_pre_hook calls _item_free, where it->letter
is not set to NULL after eina_stringshare_del.
This will cause invalid access later on. The attached patch fixes the
problem, which is reproducible in my code before the fix.
Please check if this makes sense.

I am sorry that I was unable come up with a simple test app to
demonstrate the problem.

Thanks in advance.


Brian

Signed-Off-By:Brian Wang<brian.wang.0721@gmail.com>



SVN revision: 75723
devs/felipealmeida/promises
ChunEon Park 11 years ago
parent 4f0909db06
commit 4b6636bdd1
  1. 5
      legacy/elementary/src/lib/elm_index.c

@ -29,7 +29,10 @@ _item_free(Elm_Index_Item *it)
ELM_INDEX_DATA_GET(WIDGET(it), sd);
sd->items = eina_list_remove(sd->items, it);
if (it->letter) eina_stringshare_del(it->letter);
if (it->letter) {
eina_stringshare_del(it->letter);
it->letter = NULL;
}
}
static void

Loading…
Cancel
Save