Permalink
Browse files

Fix minor overallocation during elf loading

  • Loading branch information...
hrydgard committed Jun 6, 2017
1 parent ae94516 commit 57a20f02ed9ade09bab60ca9b448527b88f965f1
Showing with 3 additions and 6 deletions.
  1. +3 −6 Core/HLE/sceKernelModule.cpp
@@ -1080,12 +1080,9 @@ static Module *__KernelLoadELFFromPtr(const u8 *ptr, u32 loadAddress, bool fromT
}
const u8 *in = ptr;
u32 size = head->elf_size;
if (head->psp_size > size)
{
size = head->psp_size;
}
newptr = new u8[head->elf_size + head->psp_size];
// Kind of odd.
u32 size = std::max(head->elf_size, head->psp_size);
newptr = new u8[size];
ptr = newptr;
magicPtr = (u32_le *)ptr;
int ret = pspDecryptPRX(in, (u8*)ptr, head->psp_size);

0 comments on commit 57a20f0

Please sign in to comment.