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

nimble/audio/bass: Add data length check in BASS remote scan #1834

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

szymon-czapracki
Copy link
Contributor

Add data length checks to remote scan operations. Now any data coming with remote scan start/stop will result in instant ATT error.

@github-actions github-actions bot added host size/XS Extra small PR labels Aug 8, 2024
@@ -251,6 +251,10 @@ ble_svc_audio_bass_receive_state_free(struct ble_svc_audio_bass_rcv_state_entry
static int
ble_svc_audio_bass_remote_scan_stopped(uint8_t *data, uint16_t data_len, uint16_t conn_handle)
{
if (data_len > 1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation .

and the error could seems to be BLE_ATT_ERR_WRITE_REQ_REJECTED

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -264,6 +268,10 @@ ble_svc_audio_bass_remote_scan_stopped(uint8_t *data, uint16_t data_len, uint16_
static int
ble_svc_audio_bass_remote_scan_started(uint8_t *data, uint16_t data_len, uint16_t conn_handle)
{
if (data_len > 1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

This commit adds data length checks to remote scan operations.
Now any data coming with remote scan start/stop will result
in instant ATT error.
@sjanc sjanc merged commit 6f5b33c into apache:master Sep 2, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
host size/XS Extra small PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants