elf32: Fix bug where vaddr was used for memory zeroing instead of paddr

This commit is contained in:
mintsuki 2020-12-05 00:44:29 +01:00
parent b75b35c557
commit 2f486fae65
3 changed files with 1 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View File

@ -375,7 +375,7 @@ int elf32_load(struct file_handle *fd, uint32_t *entry_point, uint32_t *top, uin
size_t to_zero = (size_t)(phdr.p_memsz - phdr.p_filesz);
if (to_zero) {
void *ptr = (void *)(phdr.p_vaddr + phdr.p_filesz);
void *ptr = (void *)(phdr.p_paddr + phdr.p_filesz);
memset(ptr, 0, to_zero);
}
}