summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Gruver <bgruv@google.com>2013-05-08 13:29:36 -0700
committerRicardo Cerqueira <cyanogenmod@cerqueira.org>2013-10-25 14:17:36 +0100
commitaa897b06230453519c4ec636f229c72ac0015897 (patch)
tree428e551b646cbdf016efcf35ad1e26f532687760
parent2f824d3e4835479409724ea02d0a23114cd4ff81 (diff)
downloadandroid_dalvik-aa897b06230453519c4ec636f229c72ac0015897.tar.gz
android_dalvik-aa897b06230453519c4ec636f229c72ac0015897.tar.bz2
android_dalvik-aa897b06230453519c4ec636f229c72ac0015897.zip
Move verification of class access flags to libdexcm-10.2-M1
Change-Id: I020a168cfff46e319b0bebb6c7477f0b4139c6de
-rw-r--r--libdex/DexSwapVerify.cpp5
-rw-r--r--vm/analysis/DexPrepare.cpp6
2 files changed, 5 insertions, 6 deletions
diff --git a/libdex/DexSwapVerify.cpp b/libdex/DexSwapVerify.cpp
index 24a86f9ba..2bb403e3f 100644
--- a/libdex/DexSwapVerify.cpp
+++ b/libdex/DexSwapVerify.cpp
@@ -911,6 +911,11 @@ static void* swapClassDefItem(const CheckState* state, void* ptr) {
SWAP_OFFSET4(item->annotationsOff);
SWAP_OFFSET4(item->classDataOff);
+ if ((item->accessFlags & ~ACC_CLASS_MASK) != 0) {
+ ALOGE("Bogus class access flags %x", item->accessFlags);
+ return NULL;
+ }
+
return item + 1;
}
diff --git a/vm/analysis/DexPrepare.cpp b/vm/analysis/DexPrepare.cpp
index cef1996a2..e8112d543 100644
--- a/vm/analysis/DexPrepare.cpp
+++ b/vm/analysis/DexPrepare.cpp
@@ -967,12 +967,6 @@ 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);