[at-spi2-core] Fix crash when get_process_id called with an app no longer on the bus



commit 2554a07c0bbee7defef5b2fca3a420d6cf42a770
Author: Mike Gorse <mgorse suse com>
Date:   Thu Jan 16 13:46:12 2014 -0600

    Fix crash when get_process_id called with an app no longer on the bus

 atspi/atspi-accessible.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/atspi/atspi-accessible.c b/atspi/atspi-accessible.c
index 95ac311..b06a36c 100644
--- a/atspi/atspi-accessible.c
+++ b/atspi/atspi-accessible.c
@@ -1626,8 +1626,12 @@ atspi_accessible_get_process_id (AtspiAccessible *accessible, GError **error)
   dbus_error_init (&d_error);
   reply = dbus_connection_send_with_reply_and_block (bus, message, -1, &d_error);
   dbus_message_unref (message);
-  dbus_message_get_args (reply, NULL, DBUS_TYPE_UINT32, &pid, DBUS_TYPE_INVALID);
-  dbus_message_unref (reply);
+  if (reply)
+  {
+    if (!strcmp (dbus_message_get_signature (reply), "u"))
+      dbus_message_get_args (reply, NULL, DBUS_TYPE_UINT32, &pid, DBUS_TYPE_INVALID);
+    dbus_message_unref (reply);
+  }
   if (dbus_error_is_set (&d_error))
     {
       g_warning ("GetConnectionUnixProcessID failed: %s", d_error.message);


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