Fix a couple of crashes
authorMike Gorse <mgorse@novell.com>
Fri, 31 Dec 2010 12:20:50 +0000 (07:20 -0500)
committerMike Gorse <mgorse@novell.com>
Fri, 31 Dec 2010 12:20:50 +0000 (07:20 -0500)
atspi/atspi-hyperlink.c
atspi/atspi-misc.c

index a8ca42a..fac4624 100644 (file)
@@ -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;
 }
 
index 23e3920..8dca97c 100644 (file)
@@ -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",