Merge lp:~ted/indicator-appmenu/lp934429 into lp:indicator-appmenu/0.4

Proposed by Ted Gould
Status: Merged
Merged at revision: 165
Proposed branch: lp:~ted/indicator-appmenu/lp934429
Merge into: lp:indicator-appmenu/0.4
Diff against target: 16 lines (+6/-0)
1 file modified
src/hud-search.c (+6/-0)
To merge this branch: bzr merge lp:~ted/indicator-appmenu/lp934429
Reviewer Review Type Date Requested Status
Lars Karlitski (community) Approve
Review via email: mp+93886@code.launchpad.net

Description of the change

Ensuring we always have values for GVariant

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

I'm unsure that this fixes the bug. The stacktrace shows g_variant_build_add_value crashing because receiving a NULL value, which could be

  app,
  db,
  dbus_address,
  dbus_path or
  dbus_id'

This patch only does NULL checks for 'display', 'app_icon' and 'item_icon'.

Am I missing something? (Disclaimer: I haven't reproduced the bug or tested this patch)

Btw, this should be fixed in glib, so that passing a NULL value will at least throw a fatal error.

review: Needs Information
Revision history for this message
Ted Gould (ted) wrote :

On Tue, 2012-02-21 at 08:25 +0000, Lars Uebernickel wrote:
> I'm unsure that this fixes the bug. The stacktrace shows
> g_variant_build_add_value crashing because receiving a NULL value, which
> could be
>
> app,
> db,
> dbus_address,
> dbus_path or
> dbus_id'
>
> This patch only does NULL checks for 'display', 'app_icon' and 'item_icon'.
>
> Am I missing something? (Disclaimer: I haven't reproduced the bug or tested
> this patch)

Yes :-) The line number in the stack trace. The dbus paths can't be
NULL because the other code depends on them to find the menus. So
they're already guaranteed to have a value.

> Btw, this should be fixed in glib, so that passing a NULL value will
> at least throw a fatal error.

I agree.

Revision history for this message
Lars Karlitski (larsu) wrote :

*whistles*

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/hud-search.c'
2--- src/hud-search.c 2012-02-15 15:53:59 +0000
3+++ src/hud-search.c 2012-02-20 18:21:17 +0000
4@@ -648,6 +648,12 @@
5 {
6 HudSearchSuggest * suggest = g_new0(HudSearchSuggest, 1);
7
8+ /* Ensure that the values are at least set to the NULL string for
9+ DBus even if we don't have values for them */
10+ if (display == NULL) display = "";
11+ if (app_icon == NULL) app_icon = "";
12+ if (item_icon == NULL) item_icon = "";
13+
14 suggest->display = g_strdup(display);
15 suggest->app_icon = g_strdup(app_icon);
16 suggest->item_icon = g_strdup(item_icon);

Subscribers

People subscribed via source and target branches