summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJihoon Kim <jihoon48.kim@samsung.com>2013-11-29 11:35:44 +0900
committerJihoon Kim <jihoon48.kim@samsung.com>2013-11-29 11:35:44 +0900
commitd9e7615a52be7c1a4cf6c72ca1df92ef8488d1ae (patch)
tree0fa9105d5c12ff7887fe6c95e8122c3c10b1ca95
parentbab7612bb5b55043a5d9c1f5ae27769e758c37bd (diff)
xim immodule: fix dereference before NULL check issue in client_window_set
The variable 'info' can be NULL, therefore it should be checked before accessing. This fixes CID 1039640
-rw-r--r--src/modules/ecore_imf/xim/ecore_imf_xim.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/modules/ecore_imf/xim/ecore_imf_xim.c b/src/modules/ecore_imf/xim/ecore_imf_xim.c
index 71c9fc0bf..7243b4291 100644
--- a/src/modules/ecore_imf/xim/ecore_imf_xim.c
+++ b/src/modules/ecore_imf/xim/ecore_imf_xim.c
@@ -1255,12 +1255,13 @@ _ecore_imf_xim_ic_client_window_set(Ecore_IMF_Context *ctx,
DBG("old_win=%#x, window=%#x", old_win, window);
if (old_win != 0 && old_win != window) /* XXX how do check window... */
{
- XIM_Im_Info *info;
- info = imf_context_data->im_info;
- info->ics = eina_list_remove(info->ics, imf_context_data);
- if (imf_context_data->im_info)
- imf_context_data->im_info->user = NULL;
- imf_context_data->im_info = NULL;
+ XIM_Im_Info *info = imf_context_data->im_info;
+ if (info)
+ {
+ info->ics = eina_list_remove(info->ics, imf_context_data);
+ info->user = NULL;
+ info = NULL;
+ }
}
imf_context_data->win = window;