summaryrefslogtreecommitdiff
path: root/gdbus
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2018-12-05 20:57:51 -0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2018-12-12 13:26:05 -0300
commitaad7ed9a6d5a2e6d6b55abab21eb19e1f7ba5f72 (patch)
tree0fd850f8a238ea7db875e0ea280001400a8c75ef /gdbus
parentfc458328d39b71529d7760fddee018e6458b97b4 (diff)
downloadbluez-aad7ed9a6d5a2e6d6b55abab21eb19e1f7ba5f72.tar.gz
gdbus: Make sure the object path and interface are valid
D-Bus object path and interface must be validate otherwise it can cause errors as follow: 0 0xb7f67ab1 in __kernel_vsyscall () 1 0xb7ca1cc1 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 2 0xb7ca50ee in abort () at abort.c:92 3 0xb7e30ba5 in _dbus_abort () at dbus-sysdeps.c:94 4 0xb7e267a6 in _dbus_warn_check_failed ( format=0xb7e36cd4 "arguments to %s() were incorrect, assertion \"%s\" failed in file %s line %d.\nThis is normally a bug in some application using the D-Bus library.\n") at dbus-internals.c:290 5 0xb7e16d9f in dbus_message_iter_append_basic (iter=0xbf864400, type=111, value=0xd70940) at dbus-message.c:2586 6 0x004fcdec in emit_interfaces_added (user_data=0xd70938) at gdbus/object.c:574
Diffstat (limited to 'gdbus')
-rw-r--r--gdbus/object.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdbus/object.c b/gdbus/object.c
index 617ab5eda..830175385 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -1346,6 +1346,10 @@ gboolean g_dbus_register_interface(DBusConnection *connection,
{
struct generic_data *data;
+ if (!dbus_validate_path(path, NULL) ||
+ !dbus_validate_interface(name, NULL))
+ return FALSE;
+
data = object_path_ref(connection, path);
if (data == NULL)
return FALSE;