diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2013-06-27 19:35:40 +0000 |
---|---|---|
committer | Tarmac <Unknown> | 2013-06-27 19:35:40 +0000 |
commit | b4ea3e79498d15a92f9dcf3dc875c1b92b0b3bf8 (patch) | |
tree | 375b58f28e7d68e3ab72d75914f14d0915c27759 | |
parent | 7bd45482c87a3c89569d857707240ecbb6a1f5f9 (diff) | |
parent | 104bcd689ac461a358214cd4b55f44fef67500ff (diff) | |
download | libayatana-indicator-b4ea3e79498d15a92f9dcf3dc875c1b92b0b3bf8.tar.gz libayatana-indicator-b4ea3e79498d15a92f9dcf3dc875c1b92b0b3bf8.tar.bz2 libayatana-indicator-b4ea3e79498d15a92f9dcf3dc875c1b92b0b3bf8.zip |
Fixes a crasher bug in ng's parsing of the response to org.freedesktop.DBus.StartServiceByName: The result's variant format is "(u)", not "u".
Approved by Ted Gould, PS Jenkins bot.
-rw-r--r-- | libindicator/indicator-ng.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/libindicator/indicator-ng.c b/libindicator/indicator-ng.c index b58a6c3..b372e2e 100644 --- a/libindicator/indicator-ng.c +++ b/libindicator/indicator-ng.c @@ -383,15 +383,16 @@ indicator_ng_service_appeared (GDBusConnection *connection, static void indicator_ng_service_started (GObject *source_object, - GAsyncResult *result, + GAsyncResult *res, gpointer user_data) { IndicatorNg *self = user_data; GError *error = NULL; - GVariant *reply; + GVariant *result; + guint32 start_service_reply; - reply = g_dbus_connection_call_finish (G_DBUS_CONNECTION (source_object), result, &error); - if (!reply) + result = g_dbus_connection_call_finish (G_DBUS_CONNECTION (source_object), res, &error); + if (!result) { g_warning ("Could not activate service '%s': %s", self->name, error->message); indicator_object_set_visible (INDICATOR_OBJECT (self), FALSE); @@ -399,7 +400,10 @@ indicator_ng_service_started (GObject *source_object, return; } - switch (g_variant_get_uint32 (reply)) + start_service_reply = 0; + g_variant_get (result, "(u)", &start_service_reply); + + switch (start_service_reply) { case 1: /* DBUS_START_REPLY_SUCCESS */ break; @@ -412,7 +416,7 @@ indicator_ng_service_started (GObject *source_object, g_assert_not_reached (); } - g_variant_unref (reply); + g_variant_unref (result); } static void |