Merge lp:~chrisccoulson/libdbusmenu/lp720895 into lp:libdbusmenu/0.5

Proposed by Chris Coulson
Status: Merged
Approved by: Ted Gould
Approved revision: 241
Merged at revision: 248
Proposed branch: lp:~chrisccoulson/libdbusmenu/lp720895
Merge into: lp:libdbusmenu/0.5
Diff against target: 11 lines (+1/-0)
1 file modified
libdbusmenu-gtk/menuitem.c (+1/-0)
To merge this branch: bzr merge lp:~chrisccoulson/libdbusmenu/lp720895
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+51594@code.launchpad.net

Description of the change

Check the return value of gdk_keyval_name, as passing NULL pointers
to g_variant_builder_add can cause bad things to happen. Might fix LP: #720895

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :

I moved the keyname check to before the builder is initialized to avoid a possible leak with the builder there. Otherwise all good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libdbusmenu-gtk/menuitem.c'
2--- libdbusmenu-gtk/menuitem.c 2011-02-21 16:04:44 +0000
3+++ libdbusmenu-gtk/menuitem.c 2011-02-28 18:46:14 +0000
4@@ -194,6 +194,7 @@
5 }
6
7 const gchar * keyname = gdk_keyval_name(key);
8+ g_return_val_if_fail(keyname != NULL, FALSE);
9 g_variant_builder_add(&builder, "s", keyname);
10
11 GVariant * inside = g_variant_builder_end(&builder);

Subscribers

People subscribed via source and target branches