Skip to content

Commit c877385

Browse files
cvinayakcarlescufi
authored andcommitted
Bluetooth: controller: Fix incorrect ext header flag access
Fix Periodic Advertising data population from corrupting the PDU by populating fields when there is no flags in the common extended advertising header. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent a2d4aab commit c877385

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

subsys/bluetooth/controller/ll_sw/ull_adv_sync.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,11 @@ static uint8_t adv_sync_hdr_set_clear(struct lll_adv_sync *lll_sync,
801801
/* Fill AdvData in tertiary PDU */
802802
memmove(ter_dptr, ad_data, ad_len);
803803

804+
/* Early exit if no flags set */
805+
if (!ter_com_hdr->ext_hdr_len) {
806+
return 0;
807+
}
808+
804809
/* Fill ACAD in tertiary PDU */
805810
ter_dptr_prev -= acad_len_prev;
806811
ter_dptr -= acad_len_prev;

0 commit comments

Comments
 (0)