Skip to content

BLE: fix possible truncation #9427

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

Merged
merged 1 commit into from
Jan 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,10 @@ void btle_handler(const ble_evt_t *p_ble_evt)
uint8_t const data_length_peer =
p_gap_evt->params.data_length_update_request.peer_params.max_tx_octets;

const uint8_t max_data_length = NRF_SDH_BLE_GATT_MAX_MTU_SIZE + 4 /* L2CAP header size */;

uint8_t const data_length = MIN(max_data_length, data_length_peer);
uint8_t const data_length = MIN(
NRF_SDH_BLE_GATT_MAX_MTU_SIZE + 4 /* L2CAP header size */,
data_length_peer
);

ble_gap_data_length_params_t const dlp =
{
Expand Down