Qt: Fix filling bluetooth device address

When filling bd_addr from tap_device->bd_addr[], only the first
octet was used

Change-Id: I3cb281d96126d77e5e6862e44704c7f9ab34cb78
Reviewed-on: https://code.wireshark.org/review/36152
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Signat Sibirskiy 2020-02-22 13:09:38 -08:00 committed by Anders Broman
parent d5ec6882fe
commit c6411187a0
2 changed files with 8 additions and 7 deletions

View File

@ -395,9 +395,10 @@ tap_packet_status BluetoothDeviceDialog::tapPacket(void *tapinfo_ptr, packet_inf
}
if (tap_device->has_bd_addr) {
for (int i = 0; i < 6; ++i)
bd_addr += QString("%1:").arg(tap_device->bd_addr[0], 2, 16, QChar('0'));
bd_addr.remove(bd_addr.length() - 1, 1);
for (int i = 0; i < 6; ++i) {
bd_addr += QString("%1:").arg(tap_device->bd_addr[i], 2, 16, QChar('0'));
}
bd_addr.chop(1); // remove extra character ":" from the end of the string
if (!tap_device->is_local && bd_addr != tapinfo->bdAddr)
return TAP_PACKET_REDRAW;

View File

@ -286,10 +286,10 @@ tap_packet_status BluetoothDevicesDialog::tapPacket(void *tapinfo_ptr, packet_in
}
if (tap_device->has_bd_addr) {
for (int i = 0; i < 6; ++i)
bd_addr += QString("%1:").arg(tap_device->bd_addr[0], 2, 16, QChar('0'));
bd_addr.remove(bd_addr.length() - 1, 1);
for (int i = 0; i < 6; ++i) {
bd_addr += QString("%1:").arg(tap_device->bd_addr[i], 2, 16, QChar('0'));
}
bd_addr.chop(1); // remove extra character ":" from the end of the string
manuf = get_ether_name(tap_device->bd_addr);
if (manuf) {
int pos;