summaryrefslogtreecommitdiff
path: root/gdbus
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2018-12-18 12:02:22 -0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2018-12-18 12:04:00 -0300
commit5cd995a95bb5c8d9e99840414385214f0f9c8fc8 (patch)
treedce31fa9786b510f8864341f71c1432bdf720830 /gdbus
parentaad7ed9a6d5a2e6d6b55abab21eb19e1f7ba5f72 (diff)
downloadbluez-5cd995a95bb5c8d9e99840414385214f0f9c8fc8.tar.gz
gdbus: Split validation of object path and interface
This splits the validation of object and interface so and error is properly printed for each of those.
Diffstat (limited to 'gdbus')
-rw-r--r--gdbus/object.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gdbus/object.c b/gdbus/object.c
index 830175385..49b578087 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -1346,9 +1346,15 @@ gboolean g_dbus_register_interface(DBusConnection *connection,
{
struct generic_data *data;
- if (!dbus_validate_path(path, NULL) ||
- !dbus_validate_interface(name, NULL))
+ if (!dbus_validate_path(path, NULL)) {
+ error("Invalid object path: %s", path);
return FALSE;
+ }
+
+ if (!dbus_validate_interface(name, NULL)) {
+ error("Invalid interface: %s", name);
+ return FALSE;
+ }
data = object_path_ref(connection, path);
if (data == NULL)