[automerger] Verify last array's length in readFromParcel am: 3b8bc2e450 am: 71478241eb am: e0b5c2d25e
Change-Id: Ib60d63bcc8769f10a64753f7fccf07c103b35c09
This commit is contained in:
@@ -18,6 +18,7 @@ package com.android.internal.app.procstats;
|
|||||||
|
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
|
import android.util.EventLog;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
import libcore.util.EmptyArray;
|
import libcore.util.EmptyArray;
|
||||||
|
|
||||||
@@ -529,6 +530,12 @@ public class SparseMappingTable {
|
|||||||
readCompactedLongArray(in, array, size);
|
readCompactedLongArray(in, array, size);
|
||||||
mLongs.add(array);
|
mLongs.add(array);
|
||||||
}
|
}
|
||||||
|
// Verify that last array's length is consistent with writeToParcel
|
||||||
|
if (N > 0 && mLongs.get(N - 1).length != mNextIndex) {
|
||||||
|
EventLog.writeEvent(0x534e4554, "73252178", -1, "");
|
||||||
|
throw new IllegalStateException("Expected array of length " + mNextIndex + " but was "
|
||||||
|
+ mLongs.get(N - 1).length);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user