Kernel: Fix bug in Process::create_userspace()

We used to write more than we needed to. This could lead to unwanted
page faults
This commit is contained in:
Bananymous 2023-04-25 13:21:28 +03:00
parent 7b19d6e479
commit 175f07cd2f
1 changed files with 1 additions and 1 deletions

View File

@ -83,7 +83,7 @@ namespace Kernel
}
process->m_mmu->load();
memcpy((void*)elf_program_header.p_vaddr, elf->data() + elf_program_header.p_offset, elf_program_header.p_filesz);
memset((void*)(elf_program_header.p_vaddr + elf_program_header.p_filesz), 0, elf_program_header.p_memsz);
memset((void*)(elf_program_header.p_vaddr + elf_program_header.p_filesz), 0, elf_program_header.p_memsz - elf_program_header.p_filesz);
Process::current().mmu().load();
break;
}