mirror of
https://github.com/ptitSeb/box86.git
synced 2024-11-30 13:24:01 +08:00
[ELFLOADER] Zero'd memory when using mmap and filesize smaller than memsize
This commit is contained in:
parent
159351fc3c
commit
2c58b45d8e
@ -271,6 +271,8 @@ int AllocLoadElfMemory(box86context_t* context, elfheader_t* head, int mainbin)
|
||||
printf_log(log_level, " got %p instead\n", p);
|
||||
}
|
||||
} else {
|
||||
if(e->p_memsz>e->p_filesz)
|
||||
memset((void*)((uintptr_t)p + e->p_filesz), 0, e->p_memsz-e->p_filesz);
|
||||
setProtection_elf((uintptr_t)p, head->multiblocks[n].asize, prot);
|
||||
head->multiblocks[n].p = p;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user