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
=== modified file 'libdbusmenu-glib/client.c'
--- libdbusmenu-glib/client.c 2012-11-21 18:13:53 +0000
+++ libdbusmenu-glib/client.c 2013-06-10 18:20:33 +0000
@@ -560,12 +560,16 @@
560560
561 switch (id) {561 switch (id) {
562 case PROP_DBUSNAME:562 case PROP_DBUSNAME:
563 g_return_if_fail(g_dbus_is_name(g_value_get_string(value)));
564
563 priv->dbus_name = g_value_dup_string(value);565 priv->dbus_name = g_value_dup_string(value);
564 if (priv->dbus_name != NULL && priv->dbus_object != NULL) {566 if (priv->dbus_name != NULL && priv->dbus_object != NULL) {
565 build_proxies(DBUSMENU_CLIENT(obj));567 build_proxies(DBUSMENU_CLIENT(obj));
566 }568 }
567 break;569 break;
568 case PROP_DBUSOBJECT:570 case PROP_DBUSOBJECT:
571 g_return_if_fail(g_variant_is_object_path(g_value_get_string(value)));
572
569 priv->dbus_object = g_value_dup_string(value);573 priv->dbus_object = g_value_dup_string(value);
570 if (priv->dbus_name != NULL && priv->dbus_object != NULL) {574 if (priv->dbus_name != NULL && priv->dbus_object != NULL) {
571 build_proxies(DBUSMENU_CLIENT(obj));575 build_proxies(DBUSMENU_CLIENT(obj));
@@ -2472,6 +2476,9 @@
2472DbusmenuClient *2476DbusmenuClient *
2473dbusmenu_client_new (const gchar * name, const gchar * object)2477dbusmenu_client_new (const gchar * name, const gchar * object)
2474{2478{
2479 g_return_val_if_fail(g_dbus_is_name(name), NULL);
2480 g_return_val_if_fail(g_variant_is_object_path(object), NULL);
2481
2475 DbusmenuClient * self = g_object_new(DBUSMENU_TYPE_CLIENT,2482 DbusmenuClient * self = g_object_new(DBUSMENU_TYPE_CLIENT,
2476 DBUSMENU_CLIENT_PROP_DBUS_NAME, name,2483 DBUSMENU_CLIENT_PROP_DBUS_NAME, name,
2477 DBUSMENU_CLIENT_PROP_DBUS_OBJECT, object,2484 DBUSMENU_CLIENT_PROP_DBUS_OBJECT, object,

Subscribers

People subscribed via source and target branches

to all changes: