summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2019-10-07 17:30:23 -0700
committerKyriakos Ispoglou <ispo@google.com>2019-11-07 16:19:37 -0800
commitba1e3211158be985a6344724b15ab76c66203f03 (patch)
tree9d01baef7a718e7a018c3364fb88379a2c65ae7c
parent650536f6d1470a044b417482557806b10c356724 (diff)
downloadandroid_frameworks_native-ba1e3211158be985a6344724b15ab76c66203f03.tar.gz
android_frameworks_native-ba1e3211158be985a6344724b15ab76c66203f03.tar.bz2
android_frameworks_native-ba1e3211158be985a6344724b15ab76c66203f03.zip
Sensor: use FlattenableUtils::align
Since it memsets skipped over memory now. Bug: 141890807 Test: boot, check buffer is zero'd here Change-Id: Ieb3cd90215a3ccc1dc43365ecde251a50db08553 (cherry picked from commit d58cf5acb863eddbbeb9982439965e259045940e) (cherry picked from commit dbd0eecfc7570231d5cbb76678b0358c43ee6d3c)
-rw-r--r--libs/sensor/Sensor.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/sensor/Sensor.cpp b/libs/sensor/Sensor.cpp
index a0e368c7e..2383516c9 100644
--- a/libs/sensor/Sensor.cpp
+++ b/libs/sensor/Sensor.cpp
@@ -562,7 +562,8 @@ void Sensor::flattenString8(void*& buffer, size_t& size,
uint32_t len = static_cast<uint32_t>(string8.length());
FlattenableUtils::write(buffer, size, len);
memcpy(static_cast<char*>(buffer), string8.string(), len);
- FlattenableUtils::advance(buffer, size, FlattenableUtils::align<4>(len));
+ FlattenableUtils::advance(buffer, size, len);
+ size -= FlattenableUtils::align<4>(buffer);
}
bool Sensor::unflattenString8(void const*& buffer, size_t& size, String8& outputString8) {