Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nrf fromtree] Bluetooth: Host: Fix issue where uninitialized value w… #2109

Merged

Conversation

eriksandgren
Copy link
Contributor

…as used

This change makes sure that when a call to bt_id_set_scan_own_addr is sucessful, i.e., the return value is 0, the own_addr_type will be set by the bt_id_set_scan_own_addr.

Not setting the own_addr_type in a successful call to bt_id_set_scan_own_addr causes, for example,
the start_le_scan_ext method in scan.c to use an uninitialized own_addr_type.

Eventually this results in an unexpected failure further down in start_le_scan_ext, when sending HCI command to controller with an uninitialized own_addr_type.

Signed-off-by: Erik Sandgren [email protected]
(cherry picked from commit 5f59b35)

…as used

This change makes sure that when a call to `bt_id_set_scan_own_addr` is
sucessful, i.e., the return value is 0, the `own_addr_type` will
be set by the `bt_id_set_scan_own_addr`.

Not setting the `own_addr_type` in a successful call to
`bt_id_set_scan_own_addr` causes, for example,
the `start_le_scan_ext` method in `scan.c` to use an
uninitialized `own_addr_type`.

Eventually this results in an unexpected failure further down in
`start_le_scan_ext`, when sending HCI command to controller with
an uninitialized `own_addr_type`.

Signed-off-by: Erik Sandgren <[email protected]>
(cherry picked from commit 5f59b35)
@hermabe hermabe added this to the ncs-2.8.0 milestone Oct 15, 2024
@ivaniushkov ivaniushkov self-requested a review October 15, 2024 09:00
@rlubos rlubos merged commit ad6c18d into nrfconnect:main Oct 16, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants