Skip to content

Commit 0491f2e

Browse files
committed
reios: check boot file destination ptr before loading
Abort load if ptr is null (size > 0xff0000) Fixes MINIDUMP-7W9 MINIDUMP-84B MINIDUMP-87V
1 parent 33d9a58 commit 0491f2e

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

core/reios/reios.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,20 @@ static bool reios_locate_bootfile(const char* bootfile)
9797
}
9898
bootSectors = size / 2048;
9999

100+
u8 *dest = GetMemPtr(0x8c010000, size);
101+
if (dest == nullptr) {
102+
ERROR_LOG(REIOS, "Boot file too large: %d", size);
103+
return false;
104+
}
100105
if (descrambl)
101106
{
102107
std::vector<u8> buf(size);
103108
bootFile->read(buf.data(), size, offset);
104-
descrambl_buffer(buf.data(), GetMemPtr(0x8c010000, size), size);
109+
descrambl_buffer(buf.data(), dest, size);
105110
}
106111
else
107112
{
108-
bootFile->read(GetMemPtr(0x8c010000, size), size, offset);
113+
bootFile->read(dest, size, offset);
109114
}
110115

111116
u8 data[24] = {0};

0 commit comments

Comments
 (0)