Skip to content

Commit 3a0cb96

Browse files
committed
Code analysis: Skip invalid code sections. May help #12414.
1 parent 2d4b5ff commit 3a0cb96

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Core/HLE/sceKernelModule.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -1274,6 +1274,11 @@ static Module *__KernelLoadELFFromPtr(const u8 *ptr, size_t elfSize, u32 loadAdd
12741274
std::vector<SectionID> codeSections = reader.GetCodeSections();
12751275
for (SectionID id : codeSections) {
12761276
u32 start = reader.GetSectionAddr(id);
1277+
if (!Memory::IsValidAddress(start)) {
1278+
ERROR_LOG(LOADER, "Bad section addr %08x of section %d", start, id);
1279+
continue;
1280+
}
1281+
12771282
// Note: scan end is inclusive.
12781283
u32 end = start + reader.GetSectionSize(id) - 4;
12791284

0 commit comments

Comments
 (0)