mirror of
https://github.com/apache/nuttx.git
synced 2026-05-25 09:45:55 +08:00
wireless/bt_uart: Fix ACL data buffer length verification.
Driver now validates ACL provided buffer length agaist the size of the data buffer which is defined by CONFIG_BLUETOOTH_UART_RXBUFSIZE. Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
This commit is contained in:
committed by
Xiang Xiao
parent
52482219c8
commit
29da7fc824
@@ -162,6 +162,14 @@ static void btuart_rxwork(FAR void *arg)
|
||||
else if (data[0] == H4_ACL)
|
||||
{
|
||||
pktlen = hdr->acl.len;
|
||||
|
||||
if (pktlen + H4_HEADER_SIZE + hdrlen >
|
||||
CONFIG_BLUETOOTH_UART_RXBUFSIZE)
|
||||
{
|
||||
wlwarn("WARNING: H4 packet is too long\n");
|
||||
break;
|
||||
}
|
||||
|
||||
type = BT_ACL_IN;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user