Skip to content

Commit 79d575b

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 dabf237 commit 79d575b

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
@@ -1539,6 +1539,10 @@ uint8_t ull_scan_rsp_set(struct ll_adv_set *adv, uint8_t len,
15391539
struct pdu_adv *pdu;
15401540
uint8_t idx;
15411541

1542+
if (len > PDU_AC_DATA_SIZE_MAX) {
1543+
return BT_HCI_ERR_INVALID_PARAM;
1544+
}
1545+
15421546
/* update scan pdu fields. */
15431547
prev = lll_adv_scan_rsp_peek(&adv->lll);
15441548
pdu = lll_adv_scan_rsp_alloc(&adv->lll, &idx);

0 commit comments

Comments
 (0)