From 1dd36224965c8f6fe4a0a9a3236b3fc1dad51e30 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 28 Mar 2011 17:54:12 +0100 Subject: [PATCH 01/25] When given an object path, use GVariant to check syntactic validity --- dbus/dbus-gobject.c | 2 +- dbus/dbus-gproxy.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dbus/dbus-gobject.c b/dbus/dbus-gobject.c index 98c08de..bddcd1b 100644 --- a/dbus/dbus-gobject.c +++ b/dbus/dbus-gobject.c @@ -2547,7 +2547,7 @@ dbus_g_connection_register_g_object (DBusGConnection *connection, gboolean is_first_registration; g_return_if_fail (connection != NULL); - g_return_if_fail (at_path != NULL); + g_return_if_fail (g_variant_is_object_path (at_path)); g_return_if_fail (G_IS_OBJECT (object)); /* This is a GSList of ObjectRegistration* */ diff --git a/dbus/dbus-gproxy.c b/dbus/dbus-gproxy.c index 1e7331f..3270618 100644 --- a/dbus/dbus-gproxy.c +++ b/dbus/dbus-gproxy.c @@ -1944,7 +1944,7 @@ dbus_g_proxy_new_for_name (DBusGConnection *connection, { g_return_val_if_fail (connection != NULL, NULL); g_return_val_if_fail (name != NULL, NULL); - g_return_val_if_fail (path_name != NULL, NULL); + g_return_val_if_fail (g_variant_is_object_path (path_name), NULL); g_return_val_if_fail (interface_name != NULL, NULL); return dbus_g_proxy_new (connection, name, @@ -1988,7 +1988,7 @@ dbus_g_proxy_new_for_name_owner (DBusGConnection *connection, g_return_val_if_fail (connection != NULL, NULL); g_return_val_if_fail (name != NULL, NULL); - g_return_val_if_fail (path_name != NULL, NULL); + g_return_val_if_fail (g_variant_is_object_path (path_name), NULL); g_return_val_if_fail (interface_name != NULL, NULL); if (!(unique_name = get_name_owner (DBUS_CONNECTION_FROM_G_CONNECTION (connection), name, error))) @@ -2054,7 +2054,7 @@ dbus_g_proxy_new_for_peer (DBusGConnection *connection, DBusGProxy *proxy; g_return_val_if_fail (connection != NULL, NULL); - g_return_val_if_fail (path_name != NULL, NULL); + g_return_val_if_fail (g_variant_is_object_path (path_name), NULL); g_return_val_if_fail (interface_name != NULL, NULL); proxy = dbus_g_proxy_new (connection, NULL, -- 1.7.4.1