Check Bundle length is aligned by 4 when readFromParcel.
Otherwise throw an IllegalStateException. Fix: 26885514 Test: Make the bundle length not aligned by 4 and observe the IllegalStateException. Change-Id: I57f0d5babdf1b8f1074eb2f4f76b71926db8b93c
This commit is contained in:
@@ -1601,12 +1601,13 @@ public class BaseBundle {
|
||||
private void readFromParcelInner(Parcel parcel, int length) {
|
||||
if (length < 0) {
|
||||
throw new RuntimeException("Bad length in parcel: " + length);
|
||||
|
||||
} else if (length == 0) {
|
||||
// Empty Bundle or end of data.
|
||||
mParcelledData = NoImagePreloadHolder.EMPTY_PARCEL;
|
||||
mParcelledByNative = false;
|
||||
return;
|
||||
} else if (length % 4 != 0) {
|
||||
throw new IllegalStateException("Bundle length is not aligned by 4: " + length);
|
||||
}
|
||||
|
||||
final int magic = parcel.readInt();
|
||||
|
||||
Reference in New Issue
Block a user