forked from enlightenment/efl
edje_entry: avoid strstr undefined behaviour
strstr behaviour is undefined when passing null to it, we will check if null is passed, then skip. elm_entry had issue, where crash happened when click on link for example. elementry_test -> entry -> click on link (crash will happened) T8535 Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Differential Revision: https://phab.enlightenment.org/D10877
This commit is contained in:
parent
b90c50ad17
commit
ed0572a33a
|
@ -799,20 +799,16 @@ _sel_update(Edje *ed, Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o, Entr
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_edje_entry_style_tag_check(Edje_Real_Part *rp, const char *tag)
|
_edje_entry_style_tag_check(Edje_Real_Part *rp, const char *tag)
|
||||||
{
|
{
|
||||||
|
if (!tag) return EINA_FALSE;
|
||||||
const Evas_Textblock_Style *ts = NULL;
|
const Evas_Textblock_Style *ts = NULL;
|
||||||
|
|
||||||
ts = evas_object_textblock_style_user_peek(rp->object);
|
ts = evas_object_textblock_style_user_peek(rp->object);
|
||||||
|
if (!ts) ts = evas_object_textblock_style_get(rp->object);
|
||||||
if (ts)
|
if (ts)
|
||||||
{
|
{
|
||||||
if (strstr(evas_textblock_style_get(ts), tag)) return EINA_TRUE;
|
const char *style_str = evas_textblock_style_get(ts);
|
||||||
}
|
if (!style_str) return EINA_FALSE;
|
||||||
else
|
if (strstr(style_str, tag)) return EINA_TRUE;
|
||||||
{
|
|
||||||
ts = evas_object_textblock_style_get(rp->object);
|
|
||||||
if (ts)
|
|
||||||
{
|
|
||||||
if (strstr(evas_textblock_style_get(ts), tag)) return EINA_TRUE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
|
|
Loading…
Reference in New Issue