OSDN Git Service

Reject dex files that attempt to use unspecified class access flags
authorBen Gruver <bgruv@google.com>
Mon, 6 May 2013 17:47:25 +0000 (10:47 -0700)
committerBen Gruver <bgruv@google.com>
Mon, 6 May 2013 17:47:25 +0000 (10:47 -0700)
Change-Id: Ib1ecf3dfe1856a9014c2e9b0d6a1725ba7617f98

vm/analysis/DexPrepare.cpp

index e8112d5..cef1996 100644 (file)
@@ -967,6 +967,12 @@ static bool loadAllClasses(DvmDex* pDvmDex)
         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);