diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2006-09-19 21:15:54 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2006-09-19 21:15:54 +0000 |
commit | 439de080e210d17c3809e096cbe8b3ac5ab21144 (patch) | |
tree | 7ab9b9d65291a440294075f7165207074ffbd31f /hcid/dbus-adapter.c | |
parent | 4b0b4c6b25a119e7011d2da9827481a6c1690dc0 (diff) |
Add proper UTF-8 validation of device names (both local and remote)
Diffstat (limited to 'hcid/dbus-adapter.c')
-rw-r--r-- | hcid/dbus-adapter.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hcid/dbus-adapter.c b/hcid/dbus-adapter.c index 3fbd0c36..2989536c 100644 --- a/hcid/dbus-adapter.c +++ b/hcid/dbus-adapter.c @@ -1036,8 +1036,8 @@ static DBusHandlerResult handle_dev_set_name_req(DBusConnection *conn, DBusMessa dbus_error_free(&err); return error_invalid_arguments(conn, msg); } - - if (strlen(str_ptr) == 0) { + + if (strlen(str_ptr) == 0 || !g_utf8_validate(str_ptr, -1, NULL)) { error("Name change failed: Invalid parameter"); return error_invalid_arguments(conn, msg); } |