summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Michael Wachenschwanz <mwachens@google.com> 2018-04-30 18:31:03 -0700
committer android-build-merger <android-build-merger@google.com> 2018-04-30 18:31:03 -0700
commit3884672b0dc60a864c86a0ff21ee1f1996481a39 (patch)
tree0dd6f99cf660c367552c118e31037af99ffc7c75
parent48e490bbc66379ced0f9067862e8e591ea6e8c81 (diff)
parentc78029ca3d018d23c1dabdadff9b27f239ef889c (diff)
[automerger] Increment when attempting to read protected Parcel Data am: 6a825e8ad1 am: 7ae915f9bd am: 21c05cbf8f am: 0f23470ebc am: 4af41a2977 am: 75061f171d am: d9d1fbf29a am: e1794e5b42 am: 634696f9e8
am: c78029ca3d Change-Id: Ia2288e1134ecc539dfb4e63c941f1ff0ac35dfe9
-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 07e856e3c9..0985ac8088 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -1535,7 +1535,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);
@@ -1557,7 +1562,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;
@@ -1575,7 +1585,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;