Merge lp:~charlesk/libindicator/lp-946408 into lp:libindicator/0.5

Proposed by Charles Kerr
Status: Merged
Approved by: Lars Karlitski
Approved revision: 463
Merged at revision: 465
Proposed branch: lp:~charlesk/libindicator/lp-946408
Merge into: lp:libindicator/0.5
Diff against target: 12 lines (+1/-1)
1 file modified
libindicator/indicator-image-helper.c (+1/-1)
To merge this branch: bzr merge lp:~charlesk/libindicator/lp-946408
Reviewer Review Type Date Requested Status
Lars Karlitski (community) Approve
Review via email: mp+101492@code.launchpad.net

Description of the change

Judging from these traces, some client code is passing an invalid GtkImage pointer into indicator_image_helper_update(). Even if we're not sure who the caller is, we can safeguard against crashes like this somewhat by adding a GTK_IS_IMAGE test to the image argument that gets passed in.

It would be better to find the client code that's passing in an invalid GtkImage, but none of the Stacktraces have that information.

To post a comment you must log in.
Revision history for this message
Lars Karlitski (larsu) wrote :

In my opinion, we should strive to have those sanity checks for all function parameters in public APIs.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libindicator/indicator-image-helper.c'
2--- libindicator/indicator-image-helper.c 2012-03-26 16:24:33 +0000
3+++ libindicator/indicator-image-helper.c 2012-04-11 06:43:19 +0000
4@@ -143,7 +143,7 @@
5 {
6 g_return_if_fail(name != NULL);
7 g_return_if_fail(name[0] != '\0');
8- g_return_if_fail(image != NULL);
9+ g_return_if_fail(GTK_IS_IMAGE(image));
10 gboolean seen_previously = FALSE;
11
12 /* Build us a GIcon */

Subscribers

People subscribed via source and target branches