From: Mark Doffman Date: Mon, 18 Aug 2008 13:58:27 +0000 (+0100) Subject: 2008-08-18 Mark Doffman X-Git-Tag: AT_SPI2_CORE_0_1_3~152 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4dcafcf5b529c72b9427c8499fae8acfaf39b08c;p=platform%2Fupstream%2Fat-spi2-core.git 2008-08-18 Mark Doffman * atk-adaptor/accessible.c Fix bug in impl_getState that causes a SIGSEGV. * atk-adaptor/tree.c Modification to check if parent exists before attempting to add to cache. --- diff --git a/atk-adaptor/accessible.c b/atk-adaptor/accessible.c index 96dd24d..d7970fe 100644 --- a/atk-adaptor/accessible.c +++ b/atk-adaptor/accessible.c @@ -466,6 +466,7 @@ impl_getState (DBusConnection * bus, DBusMessage * message, void *user_data) { AtkObject *object = get_object (message); dbus_uint32_t rv[2]; + dbus_uint32_t *array = rv; DBusMessage *reply; if (!object) @@ -474,7 +475,7 @@ impl_getState (DBusConnection * bus, DBusMessage * message, void *user_data) reply = dbus_message_new_method_return (message); if (reply) { - dbus_message_append_args (reply, DBUS_TYPE_ARRAY, DBUS_TYPE_INT32, &rv, + dbus_message_append_args (reply, DBUS_TYPE_ARRAY, DBUS_TYPE_UINT32, &array, 2, DBUS_TYPE_INVALID); } return reply; diff --git a/atk-adaptor/tree.c b/atk-adaptor/tree.c index 01b53a4..64258ba 100644 --- a/atk-adaptor/tree.c +++ b/atk-adaptor/tree.c @@ -39,18 +39,27 @@ append_update (DBusMessageIter * iter_array, AtkObject * obj, const char *name, *desc; int i; dbus_uint32_t role; + AtkObject *parent = NULL; gint childcount; GSList *l; g_assert(data != NULL); + parent = atk_object_get_parent(obj); + if (parent == NULL) + { + path_parent = g_strdup("/"); + } + else + { + path_parent = spi_dbus_get_path (parent); + } + dbus_message_iter_open_container (iter_array, DBUS_TYPE_STRUCT, NULL, &iter_struct); path = spi_dbus_get_path (obj); dbus_message_iter_append_basic (&iter_struct, DBUS_TYPE_OBJECT_PATH, &path); - path_parent = spi_dbus_get_path (atk_object_get_parent(obj)); - if (!path_parent) path_parent = g_strdup("/"); dbus_message_iter_append_basic (&iter_struct, DBUS_TYPE_OBJECT_PATH, &path_parent); g_free(path_parent); dbus_message_iter_open_container (&iter_struct, DBUS_TYPE_ARRAY, "o",