All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v1] client: Fix crashing command info
@ 2025-05-19 14:20 Luiz Augusto von Dentz
  2025-05-19 15:54 ` [BlueZ,v1] " bluez.test.bot
  2025-05-19 19:10 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2025-05-19 14:20 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

If command info is called without any parameters, and without connecting
any device, it will call find_set which doesn't check argc and argv are
actually valid.

Fixes: https://github.com/bluez/bluez/issues/1251
---
 client/main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/client/main.c b/client/main.c
index 36a7446d52c1..5d53a7be11e4 100644
--- a/client/main.c
+++ b/client/main.c
@@ -1641,6 +1641,9 @@ static struct GDBusProxy *find_set(int argc, char *argv[])
 	if (check_default_ctrl() == FALSE)
 		return NULL;
 
+	if (argc < 2 || !strlen(argv[1]))
+		return NULL;
+
 	proxy = find_proxies_by_path(default_ctrl->sets, argv[1]);
 	if (!proxy) {
 		bt_shell_printf("DeviceSet %s not available\n", argv[1]);
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-05-19 19:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-19 14:20 [PATCH BlueZ v1] client: Fix crashing command info Luiz Augusto von Dentz
2025-05-19 15:54 ` [BlueZ,v1] " bluez.test.bot
2025-05-19 19:10 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.