kimcinoo pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=610eee1e52eede85bc6d10474e1f8e98e65e35e9

commit 610eee1e52eede85bc6d10474e1f8e98e65e35e9
Author: Shinwoo Kim <cinoo....@samsung.com>
Date:   Fri Feb 2 18:56:58 2018 +0900

    elm: use Dbus securely
    
    The Efl.Access.Attribute is using key and value.
    The value could be NULL. If the value is NULL, then following error occurs.
    
    *error:
    arguments to dbus_message_iter_append_basic() were incorrect,
    assertion "_dbus_check_is_valid_utf8 (*string_p)" failed
    in file ../../dbus/dbus-message.c line 2712.
    This is normally a bug in some application using the D-Bus library.
    Array or variant type requires that type string be written, but 
end_dict_entry
    was written.
    The overall signature expected here was 'a{ss}' and we are on byte 3 of that
    signature.
---
 src/lib/elementary/efl_ui_widget.c    | 51 +++++++++++++++++++++++------------
 src/lib/elementary/elm_atspi_bridge.c |  1 +
 2 files changed, 35 insertions(+), 17 deletions(-)

diff --git a/src/lib/elementary/efl_ui_widget.c 
b/src/lib/elementary/efl_ui_widget.c
index c34608708f..fbf5646665 100644
--- a/src/lib/elementary/efl_ui_widget.c
+++ b/src/lib/elementary/efl_ui_widget.c
@@ -5365,26 +5365,36 @@ _efl_ui_widget_efl_access_state_set_get(Eo *obj, 
Elm_Widget_Smart_Data *pd EINA_
 EOLIAN static Eina_List*
 _efl_ui_widget_efl_access_attributes_get(Eo *obj, Elm_Widget_Smart_Data *pd 
EINA_UNUSED)
 {
+   const char *type = NULL;
+   const char *style = NULL;
    Eina_List *attr_list = NULL;
+   Efl_Access_Attribute *attr = NULL;
 
    attr_list = efl_access_attributes_get(efl_super(obj, EFL_UI_WIDGET_CLASS));
 
    //Add type and style information in addition.
-   Efl_Access_Attribute *attr = NULL;
-   attr = calloc(1, sizeof(Efl_Access_Attribute));
-   if (attr)
+   type = elm_widget_type_get(obj);
+   if (type)
      {
-        attr->key = eina_stringshare_add("type");
-        attr->value = eina_stringshare_add(elm_widget_type_get(obj));
-        attr_list = eina_list_append(attr_list, attr);
+        attr = calloc(1, sizeof(Efl_Access_Attribute));
+        if (attr)
+          {
+             attr->key = eina_stringshare_add("type");
+             attr->value = eina_stringshare_add(type);
+             attr_list = eina_list_append(attr_list, attr);
+           }
      }
 
-   attr = calloc(1, sizeof(Efl_Access_Attribute));
-   if (attr)
+   style = elm_widget_style_get(obj);
+   if (style)
      {
-        attr->key = eina_stringshare_add("style");
-        attr->value = eina_stringshare_add(elm_widget_style_get(obj));
-        attr_list = eina_list_append(attr_list, attr);
+        attr = calloc(1, sizeof(Efl_Access_Attribute));
+        if (attr)
+          {
+             attr->key = eina_stringshare_add("style");
+             attr->value = eina_stringshare_add(style);
+             attr_list = eina_list_append(attr_list, attr);
+          }
      }
 
    return attr_list;
@@ -5393,15 +5403,22 @@ _efl_ui_widget_efl_access_attributes_get(Eo *obj, 
Elm_Widget_Smart_Data *pd EINA
 EOLIAN static Eina_List *
 _elm_widget_item_efl_access_attributes_get(Eo *eo_item, Elm_Widget_Item_Data 
*pd  EINA_UNUSED)
 {
+   const char *style = NULL;
    Eina_List *attr_list = NULL;
-   attr_list = efl_access_attributes_get(efl_super(eo_item, 
ELM_WIDGET_ITEM_CLASS));
    Efl_Access_Attribute *attr = NULL;
-   attr = calloc(1, sizeof(Efl_Access_Attribute));
-   if (attr)
+
+   attr_list = efl_access_attributes_get(efl_super(eo_item, 
ELM_WIDGET_ITEM_CLASS));
+
+   style = elm_object_item_style_get(eo_item);
+   if (style)
      {
-        attr->key = eina_stringshare_add("style");
-        attr->value = eina_stringshare_add(elm_object_item_style_get(eo_item));
-        attr_list = eina_list_append(attr_list, attr);
+        attr = calloc(1, sizeof(Efl_Access_Attribute));
+        if (attr)
+          {
+             attr->key = eina_stringshare_add("style");
+             attr->value = eina_stringshare_add(style);
+             attr_list = eina_list_append(attr_list, attr);
+          }
      }
    return attr_list;
 }
diff --git a/src/lib/elementary/elm_atspi_bridge.c 
b/src/lib/elementary/elm_atspi_bridge.c
index 8d5cfe7fdf..e85d39b52e 100644
--- a/src/lib/elementary/elm_atspi_bridge.c
+++ b/src/lib/elementary/elm_atspi_bridge.c
@@ -625,6 +625,7 @@ _accessible_attributes_get(const Eldbus_Service_Interface 
*iface, const Eldbus_M
      {
         iter_entry = eldbus_message_iter_container_new(iter_dict, 'e', NULL);
         if (!iter_entry) goto error;
+fprintf(stderr, "key: %s, value: %s\n", attr->key, attr->value);
         eldbus_message_iter_arguments_append(iter_entry, "ss", attr->key, 
attr->value);
         eldbus_message_iter_container_close(iter_dict, iter_entry);
      }

-- 


Reply via email to