diff options
author | wu zheng <wu.zheng@intel.com> | 2015-01-15 13:23:24 +0800 |
---|---|---|
committer | wu zheng <wu.zheng@intel.com> | 2015-01-15 13:23:24 +0800 |
commit | 054330269e2959ba6cf645ab290a554e2364d2e2 (patch) | |
tree | 80a3a654763088feee5bd2a3e325ca26af7557be | |
parent | c632eda6c2f6318dc2bd58ced8b0308e1f63b601 (diff) | |
download | bluez-054330269e2959ba6cf645ab290a554e2364d2e2.tar.gz bluez-054330269e2959ba6cf645ab290a554e2364d2e2.tar.bz2 bluez-054330269e2959ba6cf645ab290a554e2364d2e2.zip |
Fix the error array value overflowsubmit/tizen/20150115.100801submit/accepted/tizen_common/20150115.053946
The array value overflow in the print function of hcitool.c.
Fix it.
Change-Id: Ic920df935cffc1a4d192244adaaa86ec68fcd203
Signed-off-by: Wu Zheng <wu.zheng@intel.com>
-rw-r--r-- | tools/hcitool.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/hcitool.c b/tools/hcitool.c index 722adcbd..b63d9d52 100644 --- a/tools/hcitool.c +++ b/tools/hcitool.c @@ -2419,7 +2419,7 @@ static int print_advertising_devices(int dd, uint8_t filter_type) char addr_array[18]; char *addr = addr_array; - buf_array[HCI_MAX_EVENT_SIZE] = 0; + buf_array[HCI_MAX_EVENT_SIZE-1] = 0; while ((len = read(dd, buf, HCI_MAX_EVENT_SIZE)) < 0) { if (errno == EINTR && signal_received == SIGINT) { @@ -2452,8 +2452,7 @@ static int print_advertising_devices(int dd, uint8_t filter_type) eir_parse_name(info->data, info->length, name, 29); - addr_array[18] = '\0'; - name_array[30] = '\0'; + name_array[29] = '\0'; printf("%s %s\n", addr, name); } } |