Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Merge "Fix vtable boundary check in vndk-vtable-dumper"
Browse files Browse the repository at this point in the history
  • Loading branch information
Treehugger Robot authored and Gerrit Code Review committed Jul 6, 2018
2 parents f35b629 + a203b62 commit 3369b67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vndk/tools/vtable-dumper/elf_handling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ VTable *ELFSharedObject<ELFT>::identifyVTable(uint64_t RelOffset) {
if (It != mVTables.begin() && It->getStartAddr() != RelOffset) {
It--;
}
if (It->getEndAddr() >= RelOffset) {
if (It->getStartAddr() <= RelOffset && It->getEndAddr() > RelOffset) {
return &(*It);
}
return nullptr;
Expand Down Expand Up @@ -341,7 +341,7 @@ uint64_t ELFSharedObject<ELFT>::identifyAddend(uint64_t ROffset) {
for (const SectionRef &Section : mProgBitSectionRefs) {
uint64_t Begin = Section.getAddress();
uint64_t End = Section.getAddress() + Section.getSize();
if (ROffset >= Begin && ROffset <= End) {
if (ROffset >= Begin && ROffset < End) {
return getAddendFromSection(Section, ROffset - Begin);
}
}
Expand Down

0 comments on commit 3369b67

Please sign in to comment.