Core: Fix ELF loading regression (fixes #1669)
Vicki Pfau vi@endrift.com
Sun, 16 Feb 2020 20:52:02 -0800
2 files changed,
5 insertions(+),
1 deletions(-)
M
src/core/core.c
→
src/core/core.c
@@ -370,7 +370,7 @@ size_t bsize, esize;
Elf32_Phdr* phdr = ELFProgramHeadersGetPointer(&ph, i); void* block = mCoreGetMemoryBlock(core, phdr->p_paddr, &bsize); char* bytes = ELFBytes(elf, &esize); - if (block && bsize >= phdr->p_filesz && bsize > phdr->p_offset && esize >= phdr->p_filesz + phdr->p_offset) { + if (block && bsize >= phdr->p_filesz && esize > phdr->p_offset && esize >= phdr->p_filesz + phdr->p_offset) { memcpy(block, &bytes[phdr->p_offset], phdr->p_filesz); } else { return false;