Skip to content

Commit

Permalink
Code analysis: Skip invalid code sections. May help #12414.
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Oct 15, 2019
1 parent 2d4b5ff commit 3a0cb96
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Core/HLE/sceKernelModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1274,6 +1274,11 @@ static Module *__KernelLoadELFFromPtr(const u8 *ptr, size_t elfSize, u32 loadAdd
std::vector<SectionID> codeSections = reader.GetCodeSections();
for (SectionID id : codeSections) {
u32 start = reader.GetSectionAddr(id);
if (!Memory::IsValidAddress(start)) {
ERROR_LOG(LOADER, "Bad section addr %08x of section %d", start, id);
continue;
}

// Note: scan end is inclusive.
u32 end = start + reader.GetSectionSize(id) - 4;

Expand Down

0 comments on commit 3a0cb96

Please sign in to comment.