fix (processes): changed process spawning to copy the null terminator at the end of the name

This commit is contained in:
antifallobst 2023-05-07 00:31:46 +02:00
parent 8edd425fee
commit c02fdd7249
1 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@
#include "proc/scheduler.h"
#include "utils/memory.h"
#include "utils/math.h"
#include "utils/logger.h"
#include "mm/region.h"
void process_kernel_spawn(elf_executable_T* executable) {
@ -41,7 +42,7 @@ pid_t process_spawn(pid_t parent, string_t name, elf_executable_T* executable, v
process->waiting = bitmap_init(PROCESS_BLOCK_ENUM_SIZE);
pipe_init(&process->stdin, process, NULL);
memory_copy(name, process->name, MIN(string_length(name), 127));
memory_copy(name, process->name, MIN(string_length(name)+1, 127));
process->page_map = page_map_create();
elf_mappings_apply(executable->mappings, executable->num_mappings, buffer, MEM_REGION_PROCESS_EXEC, process->page_map);