mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 09:38:37 +08:00
wireless/bt_hcicore: Fix H4 header and data buffer length verification.
Driver now validates data and H4 header length against CONFIG_IOB_BUFSIZE. Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
This commit is contained in:
committed by
Xiang Xiao
parent
08c239dcd1
commit
05358e6dd0
@@ -1802,6 +1802,12 @@ int bt_receive(FAR struct bt_driver_s *btdev, enum bt_buf_type_e type,
|
|||||||
struct bt_buf_s *buf;
|
struct bt_buf_s *buf;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
if (len + BLUETOOTH_H4_HDRLEN > CONFIG_IOB_BUFSIZE)
|
||||||
|
{
|
||||||
|
wlerr("ERROR: Data too long\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
wlinfo("data %p len %zu\n", data, len);
|
wlinfo("data %p len %zu\n", data, len);
|
||||||
|
|
||||||
/* Critical command complete/status events use the high priority work
|
/* Critical command complete/status events use the high priority work
|
||||||
|
|||||||
Reference in New Issue
Block a user