Merge change 24607 into eclair

* changes:
  Try not to crash the system server because of corrupt restore data
This commit is contained in:
Android (Google) Code Review
2009-09-10 19:13:52 -04:00

View File

@@ -327,6 +327,13 @@ public class PackageManagerBackupAgent extends BackupAgent {
try {
int num = in.readInt();
Log.v(TAG, " ... unflatten read " + num);
// Sensical?
if (num > 20) {
Log.e(TAG, "Suspiciously large sig count in restore data; aborting");
throw new IllegalStateException("Bad restore state");
}
sigs = new Signature[num];
for (int i = 0; i < num; i++) {
int len = in.readInt();