summaryrefslogtreecommitdiff
path: root/libs/binder/Parcel.cpp
diff options
context:
space:
mode:
author Android Build Merger (Role) <noreply-android-build-merger@google.com> 2018-04-18 20:08:30 +0000
committer Android Build Merger (Role) <noreply-android-build-merger@google.com> 2018-04-18 20:08:30 +0000
commite1794e5b42500b7b801729700acad51e30fc94c6 (patch)
tree2a0012e936d52cd52444a7feb41903947572c286 /libs/binder/Parcel.cpp
parent2de1de1499e6ec6575bc5f9bbaa96d621ec1eb3a (diff)
parentd9d1fbf29a5afb11af74580adc4a9e79586e4874 (diff)
[automerger] Increment when attempting to read protected Parcel Data am: 6a825e8ad1 am: 7ae915f9bd am: 21c05cbf8f am: 0f23470ebc am: 4af41a2977 am: 75061f171d am: d9d1fbf29a
Change-Id: I22b2eba7d3b5e34457e622feeb4a4992b33a54fa
Diffstat (limited to 'libs/binder/Parcel.cpp')
-rw-r--r--libs/binder/Parcel.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index e5a9346e95..cc9f687151 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -1429,7 +1429,12 @@ status_t Parcel::read(void* outData, size_t len) const
&& len <= pad_size(len)) {
if (mObjectsSize > 0) {
status_t err = validateReadData(mDataPos + pad_size(len));
- if(err != NO_ERROR) return err;
+ if(err != NO_ERROR) {
+ // Still increment the data position by the expected length
+ mDataPos += pad_size(len);
+ ALOGV("read Setting data pos of %p to %zu", this, mDataPos);
+ return err;
+ }
}
memcpy(outData, mData+mDataPos, len);
mDataPos += pad_size(len);
@@ -1451,7 +1456,12 @@ const void* Parcel::readInplace(size_t len) const
&& len <= pad_size(len)) {
if (mObjectsSize > 0) {
status_t err = validateReadData(mDataPos + pad_size(len));
- if(err != NO_ERROR) return NULL;
+ if(err != NO_ERROR) {
+ // Still increment the data position by the expected length
+ mDataPos += pad_size(len);
+ ALOGV("readInplace Setting data pos of %p to %zu", this, mDataPos);
+ return NULL;
+ }
}
const void* data = mData+mDataPos;
@@ -1469,7 +1479,11 @@ status_t Parcel::readAligned(T *pArg) const {
if ((mDataPos+sizeof(T)) <= mDataSize) {
if (mObjectsSize > 0) {
status_t err = validateReadData(mDataPos + sizeof(T));
- if(err != NO_ERROR) return err;
+ if(err != NO_ERROR) {
+ // Still increment the data position by the expected length
+ mDataPos += sizeof(T);
+ return err;
+ }
}
const void* data = mData+mDataPos;