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

Method CheckPadding

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

Source from the content-addressed store, hash-verified

737}
738
739bool DexFileVerifier::CheckPadding(size_t offset,
740 uint32_t aligned_offset,
741 DexFile::MapItemType type) {
742 if (offset < aligned_offset) {
743 if (!CheckListSize(begin_ + offset, aligned_offset - offset, sizeof(uint8_t), "section")) {
744 return false;
745 }
746 while (offset < aligned_offset) {
747 if (UNLIKELY(*ptr_ != '\0')) {
748 ErrorStringPrintf("Non-zero padding %x before section of type %zu at offset 0x%zx",
749 *ptr_,
750 static_cast<size_t>(type),
751 offset);
752 return false;
753 }
754 ptr_++;
755 offset++;
756 }
757 }
758 return true;
759}
760
761bool DexFileVerifier::CheckEncodedValue() {
762 if (!CheckListSize(ptr_, 1, sizeof(uint8_t), "encoded_value header")) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected