From: InHong Han Date: Wed, 12 Apr 2023 05:09:30 +0000 (+0900) Subject: Fix issue detected by static analysis tool X-Git-Tag: accepted/tizen/unified/20230414.125157~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F19%2F291219%2F2;p=platform%2Fcore%2Fuifw%2Fisf.git Fix issue detected by static analysis tool Dereferencing iterator it though it is already past the end of its container. Change-Id: I9e571551e73afb943af4f284882027fcced2b895 --- diff --git a/ism/demos/isf_manual_test_efl.cpp b/ism/demos/isf_manual_test_efl.cpp index e39ab76..e6514bf 100644 --- a/ism/demos/isf_manual_test_efl.cpp +++ b/ism/demos/isf_manual_test_efl.cpp @@ -69,8 +69,9 @@ static void _rotate_cb (void *data, Evas_Object *obj, void *event_info) static void _input_panel_state_cb (void *data, Ecore_IMF_Context *ctx, int value) { map::iterator it = m_test_name.find (ctx); - string test = it->second; + if (it == m_test_name.end()) return; + string test = it->second; if (value == ECORE_IMF_INPUT_PANEL_STATE_SHOW) { if (test == "MimeTypeSet") { const char *mime_type = "text/plain"; @@ -108,8 +109,9 @@ static void _focus_in_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event E { Ecore_IMF_Context *ctx = (Ecore_IMF_Context*) data; map::iterator it = m_test_name.find (ctx); - string text = it->second; + if (it == m_test_name.end()) return; + string text = it->second; if (text == "IMESizeSet") { char buf[256] = "ChangeIMESize"; ecore_imf_context_input_panel_imdata_set (ctx, buf, sizeof (buf)); @@ -120,8 +122,9 @@ static void _focus_out_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event { Ecore_IMF_Context *ctx = (Ecore_IMF_Context*) data; map::iterator it = m_test_name.find (ctx); - string test = it->second; + if (it == m_test_name.end()) return; + string test = it->second; if (test == "LanguageSet") { ecore_imf_context_input_panel_language_set (ctx, ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC); } else if (test == "LayoutSet") {