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/host: Fix invalid memset in ble_gattc_read_mult_cb_var #1791

Merged
merged 2 commits into from
Jun 12, 2024

Conversation

piotrnarajowski
Copy link
Contributor

  • Add early exit in read_var_cb for readabilty
  • Apply correct value when using memset to fill attr array in ble_gattc_read_mult_cb_var. Fixes GATT/CL/GAR/BI-13-C, GATT/CL/GAR/BI-36-C, GATT/CL/GAR/BI-38-C, GATT/CL/GAR/BI-42-C, GATT/CL/GAR/BI-44-C, GATT/CL/GAR/BV-05-C

@@ -3345,7 +3345,7 @@ ble_gattc_read_mult_cb_var(struct ble_gattc_proc *proc, int status,
return 0;
}

memset(attr, 0, sizeof(*attr));
memset(attr, 0, sizeof(*attr) * proc->read_mult.num_handles);
Copy link
Contributor

Choose a reason for hiding this comment

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

sizeof(attr)

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Instructions unclear. Now it's properly fixed

This commit applies correct value when using memset to fill attr
array. Fixes GATT/CL/GAR/BI-13-C, GATT/CL/GAR/BI-36-C,
GATT/CL/GAR/BI-38-C, GATT/CL/GAR/BI-42-C, GATT/CL/GAR/BI-44-C,
GATT/CL/GAR/BV-05-C
This commit applies early exit if status != 0.
@andrzej-kaczmarek andrzej-kaczmarek merged commit 9f845c4 into apache:master Jun 12, 2024
18 checks passed
@piotrnarajowski piotrnarajowski deleted the mult_cb branch June 12, 2024 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants