Skip to content
Commit b1e9f863 authored by Ivan Iushkov's avatar Ivan Iushkov Committed by Fabio Baltieri
Browse files

Bluetooth: Fixing UBSAN warning in CTE field parsing in adv.c/scan.c



during local testling, UBSAN reported the following warnings:
- bluetooth/host/adv.c:2067:19: runtime error: shift exponent
255 is too large for 32-bit type 'long unsigned int'
- bluetooth/host/scan.c:828:18: runtime error: shift exponent
255 is too large for 32-bit type 'long unsigned int'

It turned out that we can't use BIT() macro directly on
bt_hci_evt_le_per_advertising_report::cte_type field.
According to Core Spec, `cte_type = 0xFF` corresponds
to `No contstant tone extension`.

Added separate function to convert CTE bit field from
HCI format to bt_df_cte_type

Signed-off-by: default avatarIvan Iushkov <ivan.iushkov@nordicsemi.no>
parent b30d088d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment