Check for invalid (negative) string pool pos.
Parcel implementation would crash the system server otherwise. Any exception is OK as it'll cause the cache to be invalidated. Crash is not OK. Bug: 194632313 Fixes: 194632313 Test: atest PackageParserCacheHelperTest Change-Id: I58a4496b4646e172e6c3aee9ea17854a7ef55eaa
This commit is contained in:
@@ -56,6 +56,9 @@ public class PackageParserCacheHelper {
|
||||
mStrings.clear();
|
||||
|
||||
final int poolPosition = mParcel.readInt();
|
||||
if (poolPosition < 0) {
|
||||
throw new IllegalStateException("Invalid string pool position: " + poolPosition);
|
||||
}
|
||||
final int startPosition = mParcel.dataPosition();
|
||||
|
||||
// The pool is at the end of the parcel.
|
||||
|
||||
Reference in New Issue
Block a user