forked from enlightenment/efl
ecore_evas: Fix potential NULL dereference.
We don't want to execute any of the function below if t is NULL. Its not only about strdup but alsa ecore_x_netwm_name_set which might dereference it. CID 1039400
This commit is contained in:
parent
03c2d1c868
commit
91426926c5
|
@ -2587,7 +2587,8 @@ _ecore_evas_x_title_set(Ecore_Evas *ee, const char *t)
|
|||
{
|
||||
if (ee->prop.title) free(ee->prop.title);
|
||||
ee->prop.title = NULL;
|
||||
if (t) ee->prop.title = strdup(t);
|
||||
if (!t) return;
|
||||
ee->prop.title = strdup(t);
|
||||
ecore_x_icccm_title_set(ee->prop.window, ee->prop.title);
|
||||
ecore_x_netwm_name_set(ee->prop.window, ee->prop.title);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue