From d2ee4d8d09a37cd8c8fe5e61e1d52763022c7514 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 18 Dec 2018 12:02:22 -0300 Subject: [PATCH] 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. Change-Id: Ic936f70c7b94b9ec51c047d10d90628c66893cde Signed-off-by: himanshu --- gdbus/object.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gdbus/object.c b/gdbus/object.c index 32f154d..b86716f 100755 --- a/gdbus/object.c +++ b/gdbus/object.c @@ -1408,9 +1408,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) -- 2.7.4