Fix dereference after NULL 80/78080/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Mon, 4 Jul 2016 08:23:31 +0000 (17:23 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Mon, 4 Jul 2016 08:23:33 +0000 (17:23 +0900)
After having been compared to NULL value at e_mod_main.c:133, pointer 'text_input->resource' is passed as 1st parameter in call to function 'wl_text_input_send_private_command' at e_mod_main.c:146, where it is dereferenced at text-server-protocol.h:589.

Change-Id: Idf4809eaa23e1531bce0519210f08dab718843c3

src/e_mod_main.c

index 0e0b450c6e984ce621efa3697147ce0bc954562f..54a3b51b29db66a58c82ed25364d714cab3e0bc2 100644 (file)
@@ -143,7 +143,9 @@ _input_panel_hide(struct wl_client *client, struct wl_resource *resource, Eina_B
      {
         g_input_panel_state = E_INPUT_PANEL_STATE_WILL_HIDE;
         /* Temporarily sending private command, will need for a new wayland protocol */
-        wl_text_input_send_private_command(text_input->resource, 0, "CONFORMANT_RESET");
+        if (text_input->resource)
+          wl_text_input_send_private_command(text_input->resource, 0, "CONFORMANT_RESET");
+
         if (g_timer_will_hide)
           {
              ecore_timer_del(g_timer_will_hide);