mirror of
https://github.com/izzy2lost/ppsspp.git
synced 2026-03-10 12:43:04 -07:00
Core: Add range checks to some helpers and similar.
This commit is contained in:
@@ -401,8 +401,8 @@ int ISOFileSystem::Ioctl(u32 handle, u32 cmd, u32 indataPtr, u32 inlen, u32 outd
|
||||
return SCE_KERNEL_ERROR_ERRNO_FUNCTION_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
if (!Memory::IsValidAddress(outdataPtr) || outlen < 0x800) {
|
||||
WARN_LOG_REPORT(FILESYS, "sceIoIoctl: Invalid out pointer while reading ISO9660 volume descriptor");
|
||||
if (!Memory::IsValidRange(outdataPtr, 0x800) || outlen < 0x800) {
|
||||
WARN_LOG_REPORT(FILESYS, "sceIoIoctl: Invalid out pointer %08x while reading ISO9660 volume descriptor", outdataPtr);
|
||||
return SCE_KERNEL_ERROR_ERRNO_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
@@ -424,7 +424,7 @@ int ISOFileSystem::Ioctl(u32 handle, u32 cmd, u32 indataPtr, u32 inlen, u32 outd
|
||||
} else {
|
||||
int block = (u16)desc.firstLETableSector;
|
||||
u32 size = Memory::ValidSize(outdataPtr, (u32)desc.pathTableLength);
|
||||
u8 *out = Memory::GetPointerWrite(outdataPtr);
|
||||
u8 *out = Memory::GetPointerWriteRange(outdataPtr, size);
|
||||
|
||||
int blocks = size / blockDevice->GetBlockSize();
|
||||
blockDevice->ReadBlocks(block, blocks, out);
|
||||
|
||||
Reference in New Issue
Block a user