Bluetooth: Check H4 HCI packet types
An invalid type byte can cause an access outside the bounds of the array. Bug: 64565737 Test: Bluetooth On/Off Change-Id: Ie11dd62942f66b9fc60ebce2e4339c37d597fdf0
This commit is contained in:
parent
36cb0a2d99
commit
521621d515
1 changed files with 6 additions and 0 deletions
|
@ -81,6 +81,12 @@ void H4Protocol::OnDataReady(int fd) {
|
|||
}
|
||||
}
|
||||
hci_packet_type_ = static_cast<HciPacketType>(buffer[0]);
|
||||
if (hci_packet_type_ != HCI_PACKET_TYPE_ACL_DATA &&
|
||||
hci_packet_type_ != HCI_PACKET_TYPE_SCO_DATA &&
|
||||
hci_packet_type_ != HCI_PACKET_TYPE_EVENT) {
|
||||
LOG_ALWAYS_FATAL("%s: Unimplemented packet type %d", __func__,
|
||||
static_cast<int>(hci_packet_type_));
|
||||
}
|
||||
} else {
|
||||
hci_packetizer_.OnDataReady(fd, hci_packet_type_);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue