Io: Truncate reads/writes to valid memory.

A PSP might crash in these cases, but it's better if we avoid a crash.
This commit is contained in:
Unknown W. Brackets
2021-02-13 08:24:39 -08:00
parent c1fa4958d9
commit 788e8c3bbc
3 changed files with 20 additions and 16 deletions
+1 -1
View File
@@ -417,7 +417,7 @@ int ISOFileSystem::Ioctl(u32 handle, u32 cmd, u32 indataPtr, u32 inlen, u32 outd
return SCE_KERNEL_ERROR_ERRNO_INVALID_ARGUMENT;
} else {
int block = (u16)desc.firstLETableSector;
u32 size = (u32)desc.pathTableLength;
u32 size = Memory::ValidSize(outdataPtr, (u32)desc.pathTableLength);
u8 *out = Memory::GetPointer(outdataPtr);
int blocks = size / blockDevice->GetBlockSize();