summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinwoo Kim <cinoo.kim@samsung.com>2018-02-02 18:56:58 +0900
committerShinwoo Kim <cinoo.kim@samsung.com>2018-02-02 18:56:58 +0900
commit610eee1e52eede85bc6d10474e1f8e98e65e35e9 (patch)
treed13d780c42b1ef3db61609a1d27ba15b3f54f4c0
parentcc2e43cc4b34c4816ac13d5edaa62907e737fa86 (diff)
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.
-rw-r--r--src/lib/elementary/efl_ui_widget.c51
-rw-r--r--src/lib/elementary/elm_atspi_bridge.c1
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_
5365EOLIAN static Eina_List* 5365EOLIAN static Eina_List*
5366_efl_ui_widget_efl_access_attributes_get(Eo *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED) 5366_efl_ui_widget_efl_access_attributes_get(Eo *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
5367{ 5367{
5368 const char *type = NULL;
5369 const char *style = NULL;
5368 Eina_List *attr_list = NULL; 5370 Eina_List *attr_list = NULL;
5371 Efl_Access_Attribute *attr = NULL;
5369 5372
5370 attr_list = efl_access_attributes_get(efl_super(obj, EFL_UI_WIDGET_CLASS)); 5373 attr_list = efl_access_attributes_get(efl_super(obj, EFL_UI_WIDGET_CLASS));
5371 5374
5372 //Add type and style information in addition. 5375 //Add type and style information in addition.
5373 Efl_Access_Attribute *attr = NULL; 5376 type = elm_widget_type_get(obj);
5374 attr = calloc(1, sizeof(Efl_Access_Attribute)); 5377 if (type)
5375 if (attr)
5376 { 5378 {
5377 attr->key = eina_stringshare_add("type"); 5379 attr = calloc(1, sizeof(Efl_Access_Attribute));
5378 attr->value = eina_stringshare_add(elm_widget_type_get(obj)); 5380 if (attr)
5379 attr_list = eina_list_append(attr_list, attr); 5381 {
5382 attr->key = eina_stringshare_add("type");
5383 attr->value = eina_stringshare_add(type);
5384 attr_list = eina_list_append(attr_list, attr);
5385 }
5380 } 5386 }
5381 5387
5382 attr = calloc(1, sizeof(Efl_Access_Attribute)); 5388 style = elm_widget_style_get(obj);
5383 if (attr) 5389 if (style)
5384 { 5390 {
5385 attr->key = eina_stringshare_add("style"); 5391 attr = calloc(1, sizeof(Efl_Access_Attribute));
5386 attr->value = eina_stringshare_add(elm_widget_style_get(obj)); 5392 if (attr)
5387 attr_list = eina_list_append(attr_list, attr); 5393 {
5394 attr->key = eina_stringshare_add("style");
5395 attr->value = eina_stringshare_add(style);
5396 attr_list = eina_list_append(attr_list, attr);
5397 }
5388 } 5398 }
5389 5399
5390 return attr_list; 5400 return attr_list;
@@ -5393,15 +5403,22 @@ _efl_ui_widget_efl_access_attributes_get(Eo *obj, Elm_Widget_Smart_Data *pd EINA
5393EOLIAN static Eina_List * 5403EOLIAN static Eina_List *
5394_elm_widget_item_efl_access_attributes_get(Eo *eo_item, Elm_Widget_Item_Data *pd EINA_UNUSED) 5404_elm_widget_item_efl_access_attributes_get(Eo *eo_item, Elm_Widget_Item_Data *pd EINA_UNUSED)
5395{ 5405{
5406 const char *style = NULL;
5396 Eina_List *attr_list = NULL; 5407 Eina_List *attr_list = NULL;
5397 attr_list = efl_access_attributes_get(efl_super(eo_item, ELM_WIDGET_ITEM_CLASS));
5398 Efl_Access_Attribute *attr = NULL; 5408 Efl_Access_Attribute *attr = NULL;
5399 attr = calloc(1, sizeof(Efl_Access_Attribute)); 5409
5400 if (attr) 5410 attr_list = efl_access_attributes_get(efl_super(eo_item, ELM_WIDGET_ITEM_CLASS));
5411
5412 style = elm_object_item_style_get(eo_item);
5413 if (style)
5401 { 5414 {
5402 attr->key = eina_stringshare_add("style"); 5415 attr = calloc(1, sizeof(Efl_Access_Attribute));
5403 attr->value = eina_stringshare_add(elm_object_item_style_get(eo_item)); 5416 if (attr)
5404 attr_list = eina_list_append(attr_list, attr); 5417 {
5418 attr->key = eina_stringshare_add("style");
5419 attr->value = eina_stringshare_add(style);
5420 attr_list = eina_list_append(attr_list, attr);
5421 }
5405 } 5422 }
5406 return attr_list; 5423 return attr_list;
5407} 5424}
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
625 { 625 {
626 iter_entry = eldbus_message_iter_container_new(iter_dict, 'e', NULL); 626 iter_entry = eldbus_message_iter_container_new(iter_dict, 'e', NULL);
627 if (!iter_entry) goto error; 627 if (!iter_entry) goto error;
628fprintf(stderr, "key: %s, value: %s\n", attr->key, attr->value);
628 eldbus_message_iter_arguments_append(iter_entry, "ss", attr->key, attr->value); 629 eldbus_message_iter_arguments_append(iter_entry, "ss", attr->key, attr->value);
629 eldbus_message_iter_container_close(iter_dict, iter_entry); 630 eldbus_message_iter_container_close(iter_dict, iter_entry);
630 } 631 }