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

Commit 6910e140 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Check Bundle length is aligned by 4 when readFromParcel."

parents 3f603939 fc451f44
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -1601,12 +1601,13 @@ public class BaseBundle {
    private void readFromParcelInner(Parcel parcel, int length) {
    private void readFromParcelInner(Parcel parcel, int length) {
        if (length < 0) {
        if (length < 0) {
            throw new RuntimeException("Bad length in parcel: " + length);
            throw new RuntimeException("Bad length in parcel: " + length);

        } else if (length == 0) {
        } else if (length == 0) {
            // Empty Bundle or end of data.
            // Empty Bundle or end of data.
            mParcelledData = NoImagePreloadHolder.EMPTY_PARCEL;
            mParcelledData = NoImagePreloadHolder.EMPTY_PARCEL;
            mParcelledByNative = false;
            mParcelledByNative = false;
            return;
            return;
        } else if (length % 4 != 0) {
            throw new IllegalStateException("Bundle length is not aligned by 4: " + length);
        }
        }


        final int magic = parcel.readInt();
        final int magic = parcel.readInt();