From 6a8fb8a00e533dd519665b2394549f66c124268a Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 19 May 2025 10:17:29 -0400 Subject: [PATCH] client: Fix crashing command info 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 36a7446d5..5d53a7be1 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.47.3