File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
subsys/bluetooth/controller/ll_sw Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -296,6 +296,10 @@ u8_t ll_adv_data_set(u8_t len, u8_t const *const data)
296296 struct pdu_adv * pdu ;
297297 u8_t last ;
298298
299+ if (len > PDU_AC_SIZE_MAX ) {
300+ return BT_HCI_ERR_INVALID_PARAM ;
301+ }
302+
299303 /* Dont update data if directed or extended advertising. */
300304 radio_adv_data = radio_adv_data_get ();
301305 prev = (struct pdu_adv * )& radio_adv_data -> data [radio_adv_data -> last ][0 ];
@@ -352,6 +356,10 @@ u8_t ll_adv_scan_rsp_set(u8_t len, u8_t const *const data)
352356 struct pdu_adv * pdu ;
353357 u8_t last ;
354358
359+ if (len > PDU_AC_SIZE_MAX ) {
360+ return BT_HCI_ERR_INVALID_PARAM ;
361+ }
362+
355363 /* use the last index in double buffer, */
356364 radio_scan_data = radio_scan_data_get ();
357365 if (radio_scan_data -> first == radio_scan_data -> last ) {
Original file line number Diff line number Diff line change @@ -331,6 +331,10 @@ u8_t ll_adv_data_set(u8_t len, u8_t const *const data)
331331 struct pdu_adv * pdu ;
332332 u8_t idx ;
333333
334+ if (len > PDU_AC_SIZE_MAX ) {
335+ return BT_HCI_ERR_INVALID_PARAM ;
336+ }
337+
334338 adv = ull_adv_set_get (handle );
335339 if (!adv ) {
336340 return BT_HCI_ERR_CMD_DISALLOWED ;
@@ -382,6 +386,10 @@ u8_t ll_adv_scan_rsp_set(u8_t len, u8_t const *const data)
382386 struct pdu_adv * pdu ;
383387 u8_t idx ;
384388
389+ if (len > PDU_AC_SIZE_MAX ) {
390+ return BT_HCI_ERR_INVALID_PARAM ;
391+ }
392+
385393 adv = ull_adv_set_get (handle );
386394 if (!adv ) {
387395 return BT_HCI_ERR_CMD_DISALLOWED ;
You can’t perform that action at this time.
0 commit comments