summaryrefslogtreecommitdiffstats
path: root/libs/binder/Parcel.cpp
diff options
context:
space:
mode:
authorChad Brubaker <cbrubaker@google.com>2015-06-30 14:03:55 -0700
committerChad Brubaker <cbrubaker@google.com>2015-06-30 14:50:09 -0700
commite59cb43edad0eff28a81b18c3c4484442ff680dd (patch)
treeeef04a1b4f081422c36d14663a77744f249d4c57 /libs/binder/Parcel.cpp
parentfe608c5e3c75714e4aa6c31e048f4a15e4951411 (diff)
downloadframeworks_native-e59cb43edad0eff28a81b18c3c4484442ff680dd.zip
frameworks_native-e59cb43edad0eff28a81b18c3c4484442ff680dd.tar.gz
frameworks_native-e59cb43edad0eff28a81b18c3c4484442ff680dd.tar.bz2
Fix writeByteArray/writeInt32Array size on x64
writeByteArray writes the size using sizeof(size_t), however it is always read using readInt32(). On devices where sizeof(size_t) != 4 this causes extra bytes to be written. BUG: 22204736 Change-Id: I8d4507b6b616857ef5827f1fe9da0907d09abf0e
Diffstat (limited to 'libs/binder/Parcel.cpp')
-rw-r--r--libs/binder/Parcel.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index 31667d9..7a4ddc4 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -735,9 +735,9 @@ status_t Parcel::writeInt32Array(size_t len, const int32_t *val) {
}
if (!val) {
- return writeAligned(-1);
+ return writeInt32(-1);
}
- status_t ret = writeAligned(len);
+ status_t ret = writeInt32(static_cast<uint32_t>(len));
if (ret == NO_ERROR) {
ret = write(val, len * sizeof(*val));
}
@@ -751,9 +751,9 @@ status_t Parcel::writeByteArray(size_t len, const uint8_t *val) {
}
if (!val) {
- return writeAligned(-1);
+ return writeInt32(-1);
}
- status_t ret = writeAligned(len);
+ status_t ret = writeInt32(static_cast<uint32_t>(len));
if (ret == NO_ERROR) {
ret = write(val, len * sizeof(*val));
}