Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3884672b authored by Michael Wachenschwanz's avatar Michael Wachenschwanz Committed by android-build-merger
Browse files

[automerger] Increment when attempting to read protected Parcel Data am:...

[automerger] Increment when attempting to read protected Parcel Data am: 6a825e8a am: 7ae915f9 am: 21c05cbf am: 0f23470e am: 4af41a29 am: 75061f17 am: d9d1fbf2 am: e1794e5b am: 634696f9
am: c78029ca

Change-Id: Ia2288e1134ecc539dfb4e63c941f1ff0ac35dfe9
parents 48e490bb c78029ca
Loading
Loading
Loading
Loading
+17 −3
Original line number Diff line number Diff line
@@ -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;