From bab7612bb5b55043a5d9c1f5ae27769e758c37bd Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 29 Nov 2013 11:23:29 +0900 Subject: [PATCH] ibusimmodule: check whether pointer is NULL or not before accessing. The pointer variable str can be NULL, therefore we should check whether it is NULL or not before accessing. This fixes CID 1132621, 1132622, 1132623 --- src/modules/ecore_imf/ibus/ibus_imcontext.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/modules/ecore_imf/ibus/ibus_imcontext.c b/src/modules/ecore_imf/ibus/ibus_imcontext.c index 8499a6b494..0f8dcbb636 100644 --- a/src/modules/ecore_imf/ibus/ibus_imcontext.c +++ b/src/modules/ecore_imf/ibus/ibus_imcontext.c @@ -427,10 +427,11 @@ ecore_imf_context_ibus_preedit_string_get(Ecore_IMF_Context *ctx, *cursor_pos = 0; } - if (cursor_pos) - EINA_LOG_DBG("str : %s, cursor_pos : %d", *str, *cursor_pos); - else + if (str) EINA_LOG_DBG("str : %s", *str); + + if (cursor_pos) + EINA_LOG_DBG("cursor_pos : %d", *cursor_pos); } EAPI void @@ -458,7 +459,12 @@ ecore_imf_context_ibus_preedit_string_with_attributes_get(Ecore_IMF_Context *c if (cursor_pos) *cursor_pos = 0; } - EINA_LOG_DBG("str : %s, cursor_pos : %d", *str, *cursor_pos); + + if (str) + EINA_LOG_DBG("str : %s", *str); + + if (cursor_pos) + EINA_LOG_DBG("cursor_pos : %d", *cursor_pos); } EAPI void