diff options
-rw-r--r-- | src/sys/os/os_elf64.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sys/os/os_elf64.c b/src/sys/os/os_elf64.c index cdb42a7..53d0fb5 100644 --- a/src/sys/os/os_elf64.c +++ b/src/sys/os/os_elf64.c @@ -148,8 +148,8 @@ elf64_do_load(Elf64_Ehdr *eh, struct proc *proc) } /* Copy the segment data */ - tmp = (uintptr_t)PTR_OFFSET(eh, phdr->p_offset); - memset(PHYS_TO_VIRT(frame), tmp, phdr->p_memsz); + tmp = PTR_OFFSET(eh, phdr->p_offset); + memcpy(PHYS_TO_VIRT(frame), tmp, phdr->p_filesz); /* Map the segment */ spec.va = phdr->p_vaddr; |