e_info_server: change from eina_stringshare to char array as client title 16/239216/2 accepted/tizen/unified/20200727.132016 submit/tizen/20200727.024738
authorJunseok, Kim <juns.kim@samsung.com>
Wed, 22 Jul 2020 12:58:30 +0000 (21:58 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Thu, 23 Jul 2020 03:33:34 +0000 (03:33 +0000)
use topvwins when there're long name window, can cause E20 crash.
It seems that issue caused by sending eina_stringshare via eldbus, so replace eina_stringshare to char array as hotfix.

+ minor fix: the maximum layer name is 34 (noti_normal), so added more buffer for layer_name.

Change-Id: I07dcf5f56937f4c3178ba25a2ffd55003ebfd1ec
Signed-off-by: Junseok, Kim <juns.kim@samsung.com>
src/bin/e_info_server.c

index 9402b4380d8c0c28a9ad8219dbdd7d8ac1003412..bf7c4e7f6580779c92cce83550f921aa9425c0a9 100644 (file)
@@ -242,7 +242,8 @@ _msg_ecs_append(Eldbus_Message_Iter *iter, Eina_Bool is_visible)
         Ecore_Window pwin;
         uint32_t res_id = 0;
         pid_t pid = -1;
-        char layer_name[32];
+        char layer_name[35] = {0};
+        char title[256] = {0};
         int hwc = -1, hwc_policy = E_HWC_POLICY_NONE, pl_zpos = -999;
         int iconified = 0;
         Eina_Bool has_input_region = EINA_FALSE;
@@ -299,12 +300,14 @@ _msg_ecs_append(Eldbus_Message_Iter *iter, Eina_Bool is_visible)
 
         eldbus_message_iter_arguments_append(array_of_ec, "("VALUE_TYPE_FOR_TOPVWINS")", &struct_of_ec);
 
+        snprintf(title, sizeof(title), "%s", e_client_util_name_get(ec) ?: "NO NAME");
+
         eldbus_message_iter_arguments_append
            (struct_of_ec, VALUE_TYPE_FOR_TOPVWINS,
             win,
             res_id,
             pid,
-            e_client_util_name_get(ec) ?: "NO NAME",
+            title,
             x, y, w, h, ec->layer,
             ec->visible, mapped, ec->argb, ec->visibility.opaque, ec->visibility.obscured, ec->visibility.force_obscured, iconified,
             evas_object_visible_get(ec->frame), ec->focused, hwc, hwc_policy, pl_zpos, pwin, layer_name, has_input_region, transformed);
@@ -332,7 +335,8 @@ _msg_clients_append(Eldbus_Message_Iter *iter, Eina_Bool is_visible)
         Ecore_Window pwin;
         uint32_t res_id = 0;
         pid_t pid = -1;
-        char layer_name[32];
+        char layer_name[35] = {0};
+        char title[256] = {0};
         int hwc = -1, hwc_policy = E_HWC_POLICY_NONE, pl_zpos = -999;
         int iconified = 0;
         Eina_Bool has_input_region = EINA_FALSE;
@@ -389,12 +393,14 @@ _msg_clients_append(Eldbus_Message_Iter *iter, Eina_Bool is_visible)
 
         eldbus_message_iter_arguments_append(array_of_ec, "("VALUE_TYPE_FOR_TOPVWINS")", &struct_of_ec);
 
+        snprintf(title, sizeof(title), "%s", e_client_util_name_get(ec) ?: "NO NAME");
+
         eldbus_message_iter_arguments_append
            (struct_of_ec, VALUE_TYPE_FOR_TOPVWINS,
             win,
             res_id,
             pid,
-            e_client_util_name_get(ec) ?: "NO NAME",
+            title,
             ec->x, ec->y, ec->w, ec->h, ec->layer,
             ec->visible, mapped, ec->argb, ec->visibility.opaque, ec->visibility.obscured, ec->visibility.force_obscured, iconified,
             evas_object_visible_get(ec->frame), ec->focused, hwc, hwc_policy, pl_zpos, pwin, layer_name, has_input_region, transformed);