diff options
| author | 2018-04-18 20:08:25 +0000 | |
|---|---|---|
| committer | 2018-04-18 20:08:25 +0000 | |
| commit | 0f23470ebc0a9e3669552e02bf3fb456d37a5975 (patch) | |
| tree | 308d12ffc9ceb6b3da854ee86848dc5964535ceb | |
| parent | f4dc4cd4a30395abada70bf1c1d236f62d88cd91 (diff) | |
| parent | 21c05cbf8f6ebeacebb6cb9095c76782950a5194 (diff) | |
[automerger] Increment when attempting to read protected Parcel Data am: 6a825e8ad1 am: 7ae915f9bd am: 21c05cbf8f
Change-Id: I41fe9b982b47c06069c801571ee80f6ed8efbb38
| -rw-r--r-- | libs/binder/Parcel.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index ef72b3eb31..a4b89a9e5c 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -1159,7 +1159,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); @@ -1181,7 +1186,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; @@ -1199,7 +1209,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; |