[at-spi2-core] Fix a couple of crashes



commit 772f2891b1290a0bb152b623fb77cb770d2d99f4
Author: Mike Gorse <mgorse novell com>
Date:   Fri Dec 31 07:20:50 2010 -0500

    Fix a couple of crashes

 atspi/atspi-hyperlink.c |    5 ++++-
 atspi/atspi-misc.c      |    7 +++++++
 2 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/atspi/atspi-hyperlink.c b/atspi/atspi-hyperlink.c
index a8ca42a..fac4624 100644
--- a/atspi/atspi-hyperlink.c
+++ b/atspi/atspi-hyperlink.c
@@ -86,12 +86,15 @@ gchar *
 atspi_hyperlink_get_uri (AtspiHyperlink *obj, int i, GError **error)
 {
   dbus_int32_t d_i = i;
-  char *retval;
+  char *retval = NULL;
 
   g_return_val_if_fail (obj != NULL, NULL);
 
   _atspi_dbus_call (obj, atspi_interface_hyperlink, "GetURI", error, "i=>s", d_i, &retval);
 
+  if (!retval)
+    retval = g_strdup ("");
+
   return retval;
 }
 
diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c
index 23e3920..8dca97c 100644
--- a/atspi/atspi-misc.c
+++ b/atspi/atspi-misc.c
@@ -1096,6 +1096,13 @@ _atspi_dbus_get_property (gpointer obj, const char *interface, const char *name,
   if (!aobj)
     return FALSE;
 
+  if (!aobj->app || !aobj->app->bus)
+  {
+    g_set_error_literal (error, ATSPI_ERROR, ATSPI_ERROR_APPLICATION_GONE,
+                          _("The application no longer exists"));
+    return FALSE;
+  }
+
   message = dbus_message_new_method_call (aobj->app->bus_name,
                                           aobj->path,
                                           "org.freedesktop.DBus.Properties",



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]