Reject dex files that attempt to use unspecified class access flags
Change-Id: Ib1ecf3dfe1856a9014c2e9b0d6a1725ba7617f98
diff --git a/vm/analysis/DexPrepare.cpp b/vm/analysis/DexPrepare.cpp
index e8112d5..cef1996 100644
--- a/vm/analysis/DexPrepare.cpp
+++ b/vm/analysis/DexPrepare.cpp
@@ -967,6 +967,12 @@
classDescriptor =
dexStringByTypeIdx(pDvmDex->pDexFile, pClassDef->classIdx);
+ if ((pClassDef->accessFlags & ~ACC_CLASS_MASK) != 0) {
+ ALOGE("DexOpt: invalid access flags 0x%08x for class '%s'",
+ pClassDef->accessFlags, classDescriptor);
+ return false;
+ }
+
ALOGV("+++ loading '%s'", classDescriptor);
//newClass = dvmDefineClass(pDexFile, classDescriptor,
// NULL);