mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #13035 from pan-/fix-ble-service-data-addition
Fix capacity check when service data are added to BLE advertising payloadpull/13077/head
commit
c7cf9a9aed
|
|
@ -256,7 +256,7 @@ ble_error_t AdvertisingDataBuilder::setServiceData(
|
||||||
);
|
);
|
||||||
|
|
||||||
/* if we can't fit the new data do not proceed */
|
/* 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;
|
return BLE_ERROR_BUFFER_OVERFLOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue