diff --git a/kernel/src/sys/exec.cpp b/kernel/src/sys/exec.cpp index 280ce407..724ea934 100644 --- a/kernel/src/sys/exec.cpp +++ b/kernel/src/sys/exec.cpp @@ -55,7 +55,8 @@ Result sys_execve(Registers* regs, SyscallArgs args) { auto path = TRY(MemoryManager::strdup_from_user(args[0])); auto argv = TRY(copy_string_vector_from_userspace(args[1])); - auto envp = TRY(copy_string_vector_from_userspace(args[2])); + Vector envp; + if (args[2]) envp = TRY(copy_string_vector_from_userspace(args[2])); if ((calculate_userspace_stack_size(argv) + calculate_userspace_stack_size(envp)) > MAX_ARGV_STACK_SIZE) return err(E2BIG);