Merge lp:~mterry/indicator-application/752998 into lp:indicator-application/0.4

Proposed by Michael Terry
Status: Merged
Merged at revision: 194
Proposed branch: lp:~mterry/indicator-application/752998
Merge into: lp:indicator-application/0.4
Diff against target: 57 lines (+18/-1)
1 file modified
src/application-service-appstore.c (+18/-1)
To merge this branch: bzr merge lp:~mterry/indicator-application/752998
Reviewer Review Type Date Requested Status
Indicator Applet Developers Pending
Review via email: mp+56779@code.launchpad.net

Description of the change

Bug 752998 looks like a callback that got called after being cancelled (hits error path of callback, crashes during free function that tries to access bogus memory).

Here's a branch to fix that particular crash and also guards a couple other callbacks.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/application-service-appstore.c'
2--- src/application-service-appstore.c 2011-03-16 14:58:20 +0000
3+++ src/application-service-appstore.c 2011-04-07 14:13:15 +0000
4@@ -432,7 +432,6 @@
5 g_return_if_fail(app != NULL);
6
7 GError * error = NULL;
8- ApplicationServiceAppstorePrivate * priv = app->appstore->priv;
9 GVariant * menu = NULL, * id = NULL, * category = NULL,
10 * status = NULL, * icon_name = NULL, * aicon_name = NULL,
11 * icon_desc = NULL, * aicon_desc = NULL,
12@@ -441,6 +440,11 @@
13
14 GVariant * properties = g_dbus_proxy_call_finish(G_DBUS_PROXY(source_object), res, &error);
15
16+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
17+ g_error_free (error);
18+ return; // Must exit before accessing freed memory
19+ }
20+
21 if (app->props_cancel != NULL) {
22 g_object_unref(app->props_cancel);
23 app->props_cancel = NULL;
24@@ -454,6 +458,8 @@
25 return;
26 }
27
28+ ApplicationServiceAppstorePrivate * priv = app->appstore->priv;
29+
30 /* Grab all properties from variant */
31 GVariantIter * iter = NULL;
32 const gchar * name = NULL;
33@@ -1043,6 +1049,11 @@
34
35 GDBusProxy * proxy = g_dbus_proxy_new_for_bus_finish(res, &error);
36
37+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
38+ g_error_free (error);
39+ return; // Must exit before accessing freed memory
40+ }
41+
42 if (app->dbus_proxy_cancel != NULL) {
43 g_object_unref(app->dbus_proxy_cancel);
44 app->dbus_proxy_cancel = NULL;
45@@ -1437,6 +1448,12 @@
46 g_return_if_fail(approver != NULL);
47
48 GDBusProxy * proxy = g_dbus_proxy_new_for_bus_finish(res, &error);
49+
50+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
51+ g_error_free (error);
52+ return; // Must exit before accessing freed memory
53+ }
54+
55 ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE (approver->appstore);
56
57 if (approver->proxy_cancel != NULL) {

Subscribers

People subscribed via source and target branches