From c02fdd7249cd1f7aac39c125042226bb906ac6d2 Mon Sep 17 00:00:00 2001 From: antifallobst Date: Sun, 7 May 2023 00:31:46 +0200 Subject: [PATCH] fix (processes): changed process spawning to copy the null terminator at the end of the name --- src/proc/process.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/proc/process.c b/src/proc/process.c index 70a2165..e40363b 100644 --- a/src/proc/process.c +++ b/src/proc/process.c @@ -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);