mirror of https://github.com/ARMmbed/mbed-os.git
Fix capacity check when service data are added to BLE advertising payload.
parent
c7759fe505
commit
23e39a1dbd
|
@ -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