From b76ee41dbea4fc67a46bc75b62b3e3f590386715 Mon Sep 17 00:00:00 2001 From: Nagaraj D R Date: Thu, 17 May 2018 20:33:36 +0530 Subject: Fix possible invalid memory access Uninitialized data is read from local variable 'addr' Change-Id: Id8288428e93a8dda08d67a507fd97caf5fae080e --- client/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) mode change 100755 => 100644 client/main.c diff --git a/client/main.c b/client/main.c old mode 100755 new mode 100644 index 76842b11..17a92fda --- a/client/main.c +++ b/client/main.c @@ -1818,12 +1818,12 @@ static void cmd_disconn(int argc, char *argv[]) if (argc < 2 || strlen(argv[1]) == 0) { DBusMessageIter iter; - const char *addr; - if (g_dbus_proxy_get_property(proxy, "Address", &iter) == TRUE) + if (g_dbus_proxy_get_property(proxy, "Address", &iter) == TRUE) { + const char *addr; dbus_message_iter_get_basic(&iter, &addr); - - bt_shell_printf("Attempting to disconnect from %s\n", addr); + bt_shell_printf("Attempting to disconnect from %s\n", addr); + } } else bt_shell_printf("Attempting to disconnect from %s\n", argv[1]); } -- cgit v1.2.3