diff options
| author | 2018-04-18 20:08:32 +0000 | |
|---|---|---|
| committer | 2018-04-18 20:08:32 +0000 | |
| commit | c78029ca3d018d23c1dabdadff9b27f239ef889c (patch) | |
| tree | 26dbfc3788ec7ca7f471c732220991b6c085ebb9 | |
| parent | 2944d59824abdae1438ea350509e2e6fecadad0d (diff) | |
| parent | 634696f9e83e2336d4b7f18a6e378acb0d8cec0f (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
Change-Id: I87fa509ed5691bc801ebaa8091dfef43aab8cac6
| -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 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; |