aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2013-06-10 13:09:13 -0500
committerTed Gould <ted@gould.cx>2013-06-10 13:09:13 -0500
commit99cf6a9d90ce9cf3b53899fabddf9a2584ececeb (patch)
tree76ceb8492352c75a91740610b6bc91ed6891208f
parentddbe5f1a0c8f487c1a633834b8f5df418162af92 (diff)
downloadlibdbusmenu-99cf6a9d90ce9cf3b53899fabddf9a2584ececeb.tar.gz
libdbusmenu-99cf6a9d90ce9cf3b53899fabddf9a2584ececeb.tar.bz2
libdbusmenu-99cf6a9d90ce9cf3b53899fabddf9a2584ececeb.zip
Throw criticals on bad names and/or objects
-rw-r--r--libdbusmenu-glib/client.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c
index 4bb3217..800c96c 100644
--- a/libdbusmenu-glib/client.c
+++ b/libdbusmenu-glib/client.c
@@ -560,12 +560,16 @@ set_property (GObject * obj, guint id, const GValue * value, GParamSpec * pspec)
switch (id) {
case PROP_DBUSNAME:
+ g_return_if_fail(g_dbus_is_name(g_value_get_string(value)));
+
priv->dbus_name = g_value_dup_string(value);
if (priv->dbus_name != NULL && priv->dbus_object != NULL) {
build_proxies(DBUSMENU_CLIENT(obj));
}
break;
case PROP_DBUSOBJECT:
+ g_return_if_fail(g_variant_is_object_path(g_value_get_string(value)));
+
priv->dbus_object = g_value_dup_string(value);
if (priv->dbus_name != NULL && priv->dbus_object != NULL) {
build_proxies(DBUSMENU_CLIENT(obj));
@@ -2472,6 +2476,9 @@ update_layout (DbusmenuClient * client)
DbusmenuClient *
dbusmenu_client_new (const gchar * name, const gchar * object)
{
+ g_return_val_if_fail(g_dbus_is_name(name), NULL);
+ g_return_val_if_fail(g_variant_is_object_path(object), NULL);
+
DbusmenuClient * self = g_object_new(DBUSMENU_TYPE_CLIENT,
DBUSMENU_CLIENT_PROP_DBUS_NAME, name,
DBUSMENU_CLIENT_PROP_DBUS_OBJECT, object,