[PATCH BlueZ 3/3] shared/shell: add check to shell_exec()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When passing a Unicode character to bluetoothctl, the application
crashes in dbus:

dbus[5324]: arguments to dbus_message_iter_append_basic() were
incorrect, assertion "_dbus_check_is_valid_utf8 (*string_p)"
failed in file .../dbus-message.c line 2765.

Check that all characters are written in utf8.

Fixes: https://github.com/bluez/bluez/issues/1137
---
 src/shared/shell.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/shared/shell.c b/src/shared/shell.c
index 107fc7a76..b77842177 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
@@ -678,6 +678,9 @@ static int shell_exec(int argc, char *argv[])
 	if (!data.menu || !argv[0])
 		return -EINVAL;
 
+	if (!argsisutf8(argc, argv))
+		return -EINVAL;
+
 	err  = menu_exec(default_menu, argc, argv);
 	if (err == -ENOENT) {
 		err  = menu_exec(data.menu->entries, argc, argv);
-- 
2.34.1





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux