ximmodule: check whether pointer is NULL before accessing in xim_preedit_callback_set
authorJihoon Kim <jihoon48.kim@samsung.com>
Tue, 3 Dec 2013 04:32:15 +0000 (13:32 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Tue, 3 Dec 2013 04:32:15 +0000 (13:32 +0900)
ecore_imf_context_data_get () can return NULL, so it should be checked before using the result value.

This fixes CID 1135273

src/modules/ecore_imf/xim/ecore_imf_xim.c

index 7243b42..da33e3c 100644 (file)
@@ -1062,6 +1062,8 @@ _ecore_imf_xim_preedit_callback_set(Ecore_IMF_Context *ctx)
 {
    Ecore_IMF_Context_Data *imf_context_data;
    imf_context_data = ecore_imf_context_data_get(ctx);
+   if (!imf_context_data)
+     return XVaCreateNestedList(0, NULL);
 
    imf_context_data->preedit_start_cb.client_data = (XPointer)ctx;
    imf_context_data->preedit_start_cb.callback = (XIMProc)_ecore_imf_xim_preedit_start_call;