Skip to content

Commit 95e359d

Browse files
joerchancarlescufi
authored andcommitted
Bluetooth: controller: Check length field of scan response data
Check the length field of the scan response data. Signed-off-by: Joakim Andersson <[email protected]>
1 parent e2068d1 commit 95e359d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

subsys/bluetooth/controller/ll_sw/ull_adv.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,6 +1589,10 @@ uint8_t ull_scan_rsp_set(struct ll_adv_set *adv, uint8_t len,
15891589
struct pdu_adv *pdu;
15901590
uint8_t idx;
15911591

1592+
if (len > PDU_AC_DATA_SIZE_MAX) {
1593+
return BT_HCI_ERR_INVALID_PARAM;
1594+
}
1595+
15921596
/* update scan pdu fields. */
15931597
prev = lll_adv_scan_rsp_peek(&adv->lll);
15941598
pdu = lll_adv_scan_rsp_alloc(&adv->lll, &idx);

0 commit comments

Comments
 (0)