diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/bluetooth-player.c | 1 | ||||
-rw-r--r-- | tools/hciattach.c | 2 | ||||
-rw-r--r-- | tools/hcitool.c | 23 |
3 files changed, 17 insertions, 9 deletions
diff --git a/tools/bluetooth-player.c b/tools/bluetooth-player.c index f10d9be5..f090e1b1 100644 --- a/tools/bluetooth-player.c +++ b/tools/bluetooth-player.c @@ -654,6 +654,7 @@ static void cmd_show(int argc, char *argv[]) rl_printf("Player %s\n", g_dbus_proxy_get_path(proxy)); print_property(proxy, "Name"); + print_property(proxy, "Searchable"); print_property(proxy, "Repeat"); print_property(proxy, "Equalizer"); print_property(proxy, "Shuffle"); diff --git a/tools/hciattach.c b/tools/hciattach.c index db11f9a9..3535faa7 100644 --- a/tools/hciattach.c +++ b/tools/hciattach.c @@ -1530,7 +1530,7 @@ int main(int argc, char *argv[]) dev[0] = 0; if (!strchr(opt, '/')) strcpy(dev, "/dev/"); - strcat(dev, opt); + strncat(dev, opt, PATH_MAX); break; case 1: diff --git a/tools/hcitool.c b/tools/hcitool.c index 648a0f7d..2c84dc7d 100644 --- a/tools/hcitool.c +++ b/tools/hcitool.c @@ -2404,7 +2404,9 @@ failed: static int print_advertising_devices(int dd, uint8_t filter_type) { - unsigned char buf[HCI_MAX_EVENT_SIZE], *ptr; + unsigned char buf_array[HCI_MAX_EVENT_SIZE+1] = {0}; + unsigned char *buf = buf_array; + unsigned char *ptr = NULL; struct hci_filter nf, of; struct sigaction sa; socklen_t olen; @@ -2431,11 +2433,14 @@ static int print_advertising_devices(int dd, uint8_t filter_type) sigaction(SIGINT, &sa, NULL); while (1) { - evt_le_meta_event *meta; - le_advertising_info *info; - char addr[18]; + evt_le_meta_event *meta = NULL; + le_advertising_info *info = NULL; + char addr_array[18]; + char *addr = addr_array; + + buf[HCI_MAX_EVENT_SIZE] = 0; - while ((len = read(dd, buf, sizeof(buf))) < 0) { + while ((len = read(dd, buf, HCI_MAX_EVENT_SIZE)) < 0) { if (errno == EINTR && signal_received == SIGINT) { len = 0; goto done; @@ -2457,14 +2462,16 @@ static int print_advertising_devices(int dd, uint8_t filter_type) /* Ignoring multiple reports */ info = (le_advertising_info *) (meta->data + 1); if (check_report_filter(filter_type, info)) { - char name[30]; + char name_array[30]; + char *name = name_array; - memset(name, 0, sizeof(name)); + memset(name, 0, 30); ba2str(&info->bdaddr, addr); eir_parse_name(info->data, info->length, - name, sizeof(name) - 1); + name, 29); + name[29] = '\0'; printf("%s %s\n", addr, name); } } |