mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-17 11:24:27 +01:00
Avoid an out of bounds mem access.
This commit is contained in:
1 parent
e7aabc8f53
commit
d5c7fb3f0e
1 file changed
+1
-1
@@ -1500,7 +1500,7 @@ u32 sceKernelReferThreadStatus(u32 threadID, u32 statusPtr)
|
||||
|
||||
t->nt.nativeSize = THREADINFO_SIZE_AFTER_260;
|
||||
if (wantedSize != 0)
|
||||
Memory::Memcpy(statusPtr, &t->nt, wantedSize);
|
||||
Memory::Memcpy(statusPtr, &t->nt, std::min(wantedSize, (u32)sizeof(t->nt)));
|
||||
// TODO: What is this value? Basic tests show 0...
|
||||
if (wantedSize > sizeof(t->nt))
|
||||
Memory::Memset(statusPtr + sizeof(t->nt), 0, wantedSize - sizeof(t->nt));
|
||||
|
||||
Reference in new issue
Block a user