MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / CheckInterAnnotationSetItem

Method CheckInterAnnotationSetItem

Bcore/src/main/cpp/dex/dex_file_verifier.cc:2539–2567  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2537}
2538
2539bool DexFileVerifier::CheckInterAnnotationSetItem() {
2540 const DexFile::AnnotationSetItem* set = reinterpret_cast<const DexFile::AnnotationSetItem*>(ptr_);
2541 const uint32_t* offsets = set->entries_;
2542 uint32_t count = set->size_;
2543 uint32_t last_idx = 0;
2544
2545 for (uint32_t i = 0; i < count; i++) {
2546 if (*offsets != 0 && !CheckOffsetToTypeMap(*offsets, DexFile::kDexTypeAnnotationItem)) {
2547 return false;
2548 }
2549
2550 // Get the annotation from the offset and the type index for the annotation.
2551 const DexFile::AnnotationItem* annotation =
2552 reinterpret_cast<const DexFile::AnnotationItem*>(begin_ + *offsets);
2553 const uint8_t* data = annotation->annotation_;
2554 DECODE_UNSIGNED_CHECKED_FROM(data, idx);
2555
2556 if (UNLIKELY(last_idx >= idx && i != 0)) {
2557 ErrorStringPrintf("Out-of-order entry types: %x then %x", last_idx, idx);
2558 return false;
2559 }
2560
2561 last_idx = idx;
2562 offsets++;
2563 }
2564
2565 ptr_ = reinterpret_cast<const uint8_t*>(offsets);
2566 return true;
2567}
2568
2569bool DexFileVerifier::CheckInterClassDataItem() {
2570 ClassDataItemIterator it(*dex_file_, ptr_);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected