Merge pull request #13035 from pan-/fix-ble-service-data-addition

Fix capacity check when service data are added to BLE advertising payload
pull/13077/head
Martin Kojtal 2020-06-05 10:49:43 +02:00 committed by GitHub
commit c7cf9a9aed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -256,7 +256,7 @@ ble_error_t AdvertisingDataBuilder::setServiceData(
);
/* if we can't fit the new data do not proceed */
if (total_size > data.size() - (_payload_length - old_size)) {
if (total_size > (_buffer.size() - (_payload_length - old_size))) {
return BLE_ERROR_BUFFER_OVERFLOW;
}