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)
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_
3514 if (_accel_is_gl()) 3514 if (_accel_is_gl())
3515 { 3515 {
3516// add all engines with selected engine first - if any 3516// add all engines with selected engine first - if any
3517 enginelist[p++] = ENGINE_GET(); 3517 if (ENGINE_GET())
3518 enginelist[p++] = ENGINE_GET();
3518 3519
3519// add all engines with gl/accelerated ones first - only engines compiled 3520// add all engines with gl/accelerated ones first - only engines compiled
3520#ifdef HAVE_ELEMENTARY_X 3521#ifdef HAVE_ELEMENTARY_X
@@ -3558,8 +3559,9 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
3558 if (elm_config_preferred_engine_get()) 3559 if (elm_config_preferred_engine_get())
3559 enginelist[p++] = elm_config_preferred_engine_get(); 3560 enginelist[p++] = elm_config_preferred_engine_get();
3560// add check _elm_gl_preference whether "none" or not 3561// add check _elm_gl_preference whether "none" or not
3561 else if (!elm_config_accel_preference_get() || 3562 else if (_elm_config->engine &&
3562 strcmp(elm_config_accel_preference_get(),"none")) 3563 elm_config_accel_preference_get() &&
3564 !strcmp(elm_config_accel_preference_get(),"none"))
3563 enginelist[p++] = _elm_config->engine; 3565 enginelist[p++] = _elm_config->engine;
3564// add all engines with gl/accelerated ones first - only engines compiled 3566// add all engines with gl/accelerated ones first - only engines compiled
3565#ifdef HAVE_ELEMENTARY_X 3567#ifdef HAVE_ELEMENTARY_X