Merge "Update Parcel readLazyValue to ignore negative object lengths" into tm-dev

This commit is contained in:
Hao Ke
2022-10-05 20:03:28 +00:00
committed by Android (Google) Code Review

View File

@@ -4388,6 +4388,9 @@ public final class Parcel {
int type = readInt();
if (isLengthPrefixed(type)) {
int objectLength = readInt();
if (objectLength < 0) {
return null;
}
int end = MathUtils.addOrThrow(dataPosition(), objectLength);
int valueLength = end - start;
setDataPosition(end);