Skip to content

Commit c7cf9a9

Browse files
authored
Merge pull request #13035 from pan-/fix-ble-service-data-addition
Fix capacity check when service data are added to BLE advertising payload
2 parents 3ef2b16 + 23e39a1 commit c7cf9a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

features/FEATURE_BLE/source/gap/AdvertisingDataBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ ble_error_t AdvertisingDataBuilder::setServiceData(
256256
);
257257

258258
/* if we can't fit the new data do not proceed */
259-
if (total_size > data.size() - (_payload_length - old_size)) {
259+
if (total_size > (_buffer.size() - (_payload_length - old_size))) {
260260
return BLE_ERROR_BUFFER_OVERFLOW;
261261
}
262262

0 commit comments

Comments
 (0)