aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-05-12 15:57:25 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-05-12 15:57:25 +0000
commite2f729b2f4d3f56f5e3b89548953977e786532e5 (patch)
treec8472defb990cbf5e4ff718f4a5f288b7c7819f8
parente27a96aead40b1e7167f0cf2e94adc3410b379e9 (diff)
parentdbcdb271fb2f62c04b653a2c62ba955382945f2c (diff)
downloadbt-android-platform-12.1.0_r18.tar.gz
Merge cherrypicks of ['googleplex-android-review.googlesource.com/22316070'] into sc-v2-platform-release.android-platform-12.1.0_r18android-platform-12.1.0_r17
Change-Id: If5b09cf32fc63036bf7882d6856bc234e6f1dd6f
-rw-r--r--stack/gatt/gatt_utils.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/stack/gatt/gatt_utils.cc b/stack/gatt/gatt_utils.cc
index 146dee207..a2977e843 100644
--- a/stack/gatt/gatt_utils.cc
+++ b/stack/gatt/gatt_utils.cc
@@ -1498,6 +1498,13 @@ void gatt_end_operation(tGATT_CLCB* p_clcb, tGATT_STATUS status, void* p_data) {
cb_data.att_value.handle = p_clcb->s_handle;
cb_data.att_value.len = p_clcb->counter;
+ if (cb_data.att_value.len > GATT_MAX_ATTR_LEN) {
+ LOG(WARNING) << __func__
+ << StringPrintf(" Large cb_data.att_value, size=%d",
+ cb_data.att_value.len);
+ cb_data.att_value.len = GATT_MAX_ATTR_LEN;
+ }
+
if (p_data && p_clcb->counter)
memcpy(cb_data.att_value.value, p_data, cb_data.att_value.len);
}