aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Pawlowski <jpawlowski@google.com>2024-08-01 00:18:25 +0200
committeraoleary <seanm187@gmail.com>2024-12-30 07:26:33 +0000
commit6e82186a7291424607266396de51803d9276ab89 (patch)
treeb344edad9922f7bd408659b47d454f5e8d18413b
parentcba3f48e6ae81d9449db7a35eda0043be3f7b842 (diff)
Fix "GATT Read Multiple Variable Response" builder
0 length value is perfectly fine, and should result in just length added into the packet. Currently, for 0 length value we just break out of loop, and don't add any value. This means, that if first characetristic in response had 0 length, we would return empty packet. Ignore-AOSP-First: security fix Test: mma -j32; Bug: 352696105 Bug: 356886209 Flag: exempt, obvious logic fix (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:676d4d0b0bc423fae086f8edf6b9e482780d07d1) Merged-In: Ida4f6b566cf9fa40fc5330d8084c29669ccaa608 Change-Id: Ida4f6b566cf9fa40fc5330d8084c29669ccaa608
-rw-r--r--system/stack/gatt/gatt_sr.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/system/stack/gatt/gatt_sr.cc b/system/stack/gatt/gatt_sr.cc
index 50967fa0f1..1aa5d6c145 100644
--- a/system/stack/gatt/gatt_sr.cc
+++ b/system/stack/gatt/gatt_sr.cc
@@ -198,7 +198,7 @@ static void build_read_multi_rsp(tGATT_SR_CMD* p_cmd, uint16_t mtu) {
len = std::min((size_t) p_rsp->attr_value.len, mtu - total_len);
- if (len == 0) {
+ if (total_len == mtu && p_rsp->attr_value.len > 0) {
VLOG(1) << "Buffer space not enough for this data item, skipping";
break;
}