elm_atspi_bridge: initialize variables 74/229274/1
authorShinwoo Kim <cinoo.kim@samsung.com>
Mon, 30 Mar 2020 05:19:19 +0000 (05:19 +0000)
committerShinwoo Kim <cinoo.kim@samsung.com>
Tue, 31 Mar 2020 01:25:58 +0000 (10:25 +0900)
The efl_access_text_attribute_get is resolved by elm_entry.
Please refer to _elm_entry_efl_access_text_attribute_get first.
Uninitialized variables are used for its parameters, and it is able to
return before setting these variables.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11619

Change-Id: I14ef91d723a4bf0326c6e90e45226109857268c6

src/lib/elementary/elm_atspi_bridge.c

index f09951a..9e90835 100644 (file)
@@ -2090,7 +2090,7 @@ _text_string_at_offset_get(const Eldbus_Service_Interface *iface, const Eldbus_M
    const char *obj_path = eldbus_message_path_get(msg);
    char *str;
    Efl_Access_Text_Granularity gran;
-   int start, end;
+   int start = 0, end = 0;
    Eldbus_Message *ret;
    Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
    Eo *obj = _bridge_object_from_path(bridge, obj_path);
@@ -2310,7 +2310,7 @@ _text_attribute_value_get(const Eldbus_Service_Interface *iface, const Eldbus_Me
    char *value = NULL;
    Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
    Eo *obj = _bridge_object_from_path(bridge, obj_path);
-   int start, end;
+   int start = 0, end = 0;
    Eldbus_Message *ret;
    Eina_Bool res = EINA_FALSE;
    Eina_Iterator *annotations;
@@ -2376,7 +2376,7 @@ _text_attributes_get(const Eldbus_Service_Interface *iface, const Eldbus_Message
    const char *obj_path = eldbus_message_path_get(msg);
    Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
    Eo *obj = _bridge_object_from_path(bridge, obj_path);
-   int start, end;
+   int start = 0, end = 0;
    Eldbus_Message *ret;
    Eldbus_Message_Iter *iter, *iter_array;
    Efl_Access_Text_Attribute *attr;
@@ -2990,7 +2990,7 @@ _text_run_attributes_get(const Eldbus_Service_Interface *iface, const Eldbus_Mes
    const char *obj_path = eldbus_message_path_get(msg);
    Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
    Eo *obj = _bridge_object_from_path(bridge, obj_path);
-   int start, end;
+   int start = 0, end = 0;
    Eldbus_Message *ret;
    Eldbus_Message_Iter *iter, *iter_array;
    Eina_List *attrs, *defaults;