Skip to content

Commit aa34054

Browse files
smore-loremuhomorr2
authored andcommitted
PM: Restrict subclass construction.
Don't construct a random class just because you were asked to. Bug: 373467684 Test: atest PackageParsingPerfTest Flag: EXEMPT bugfix (cherry picked from commit 65c1a90) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:cfd0ded301a5848b9b2caedb44878ae6ff0a7456) Merged-In: I328eca7b8de1eab637e3991adeb2e1d147c30268 Change-Id: I328eca7b8de1eab637e3991adeb2e1d147c30268
1 parent 62cefe0 commit aa34054

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/java/android/content/pm/PackageParser.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7764,6 +7764,10 @@ private static <T extends IntentInfo> ArrayList<T> createIntentsList(Parcel in)
77647764
final ArrayList<T> intentsList;
77657765
try {
77667766
final Class<T> cls = (Class<T>) Class.forName(componentName);
7767+
if (!IntentInfo.class.isAssignableFrom(cls)) {
7768+
throw new AssertionError("Intent list requires subclass of IntentInfo, not: "
7769+
+ componentName);
7770+
}
77677771
final Constructor<T> cons = cls.getConstructor(Parcel.class);
77687772

77697773
intentsList = new ArrayList<>(N);

0 commit comments

Comments
 (0)