Update last commit to use IsValidRange instead of IsValidAddress.

This commit is contained in:
Henrik Rydgård committed 2019-10-13 16:21:52 +02:00
1 parent 8a6a494599
commit 29950c0ad5
1 file changed
+5 -5
+5 -5
View File
@@ -1274,13 +1274,13 @@ 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;
u32 len = end + 4 - start;
if (!Memory::IsValidRange(start, len)) {
ERROR_LOG(LOADER, "Bad section %08x (len %08x) of section %d", start, len, id);
continue;
}
if (start < module->textStart)
module->textStart = start;