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:
Chongqing Lei
2025-04-10 20:12:36 +02:00
committed by Xiang Xiao
parent 52482219c8
commit 29da7fc824
+8
View File
@@ -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