summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoungbok Shin <youngb.shin@samsung.com>2016-02-05 08:15:29 +0100
committerCedric BAIL <cedric@osg.samsung.com>2016-02-05 08:45:19 +0100
commitadc6e4e0da809c6cb5bf284b482260bdbd42dd25 (patch)
tree2ae6a7fa951c1479ab7ef2b32726af1ff6909569
parentfe4a4693bd1a15f0dca048e295fa68ca3d407175 (diff)
downloadelementary-adc6e4e0da809c6cb5bf284b482260bdbd42dd25.tar.gz
win: fix a possible crash in elm_win_add
Summary: The enginelist[0] can be NULL in some very rare cases. Then enginelist[0] will be used for strcmp and it make a crash. @fix Test Plan: N/A Reviewers: raster, cedric, woohyun, jypark, jaehwan Differential Revision: https://phab.enlightenment.org/D3649 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/lib/elm_win.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c
index a3d139e79..24041a93d 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -3514,7 +3514,8 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
if (_accel_is_gl())
{
// add all engines with selected engine first - if any
- enginelist[p++] = ENGINE_GET();
+ if (ENGINE_GET())
+ enginelist[p++] = ENGINE_GET();
// add all engines with gl/accelerated ones first - only engines compiled
#ifdef HAVE_ELEMENTARY_X
@@ -3558,8 +3559,9 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
if (elm_config_preferred_engine_get())
enginelist[p++] = elm_config_preferred_engine_get();
// add check _elm_gl_preference whether "none" or not
- else if (!elm_config_accel_preference_get() ||
- strcmp(elm_config_accel_preference_get(),"none"))
+ else if (_elm_config->engine &&
+ elm_config_accel_preference_get() &&
+ !strcmp(elm_config_accel_preference_get(),"none"))
enginelist[p++] = _elm_config->engine;
// add all engines with gl/accelerated ones first - only engines compiled
#ifdef HAVE_ELEMENTARY_X