Merge lp:~ted/libdbusmenu/protect-new into lp:libdbusmenu/13.10

Proposed by Ted Gould
Status: Merged
Approved by: Ted Gould
Approved revision: 449
Merged at revision: 458
Proposed branch: lp:~ted/libdbusmenu/protect-new
Merge into: lp:libdbusmenu/13.10
Diff against target: 30 lines (+7/-0)
1 file modified
libdbusmenu-glib/client.c (+7/-0)
To merge this branch: bzr merge lp:~ted/libdbusmenu/protect-new
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Charles Kerr (community) Approve
Review via email: mp+168509@code.launchpad.net

Commit message

Protect client_new functions from bad dbus names and objects

Description of the change

HUD seems to be passing bad values and causing GProxy to be unhappy through DBusmenu. Let's push that error up the stack one so we can track it easier.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Charles Kerr (charlesk) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libdbusmenu-glib/client.c'
2--- libdbusmenu-glib/client.c 2012-11-21 18:13:53 +0000
3+++ libdbusmenu-glib/client.c 2013-06-10 18:20:33 +0000
4@@ -560,12 +560,16 @@
5
6 switch (id) {
7 case PROP_DBUSNAME:
8+ g_return_if_fail(g_dbus_is_name(g_value_get_string(value)));
9+
10 priv->dbus_name = g_value_dup_string(value);
11 if (priv->dbus_name != NULL && priv->dbus_object != NULL) {
12 build_proxies(DBUSMENU_CLIENT(obj));
13 }
14 break;
15 case PROP_DBUSOBJECT:
16+ g_return_if_fail(g_variant_is_object_path(g_value_get_string(value)));
17+
18 priv->dbus_object = g_value_dup_string(value);
19 if (priv->dbus_name != NULL && priv->dbus_object != NULL) {
20 build_proxies(DBUSMENU_CLIENT(obj));
21@@ -2472,6 +2476,9 @@
22 DbusmenuClient *
23 dbusmenu_client_new (const gchar * name, const gchar * object)
24 {
25+ g_return_val_if_fail(g_dbus_is_name(name), NULL);
26+ g_return_val_if_fail(g_variant_is_object_path(object), NULL);
27+
28 DbusmenuClient * self = g_object_new(DBUSMENU_TYPE_CLIENT,
29 DBUSMENU_CLIENT_PROP_DBUS_NAME, name,
30 DBUSMENU_CLIENT_PROP_DBUS_OBJECT, object,

Subscribers

People subscribed via source and target branches

to all changes: