From d7427ff2fab7a0424b7f4c1868bc3cbb01cdfc72 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 4 May 2023 02:39:13 +0300 Subject: [PATCH] Make sure InterpreterPath has \0 character by default --- Execute/Elf/BaseLoad.cpp | 2 +- Execute/Elf/Exec.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Execute/Elf/BaseLoad.cpp b/Execute/Elf/BaseLoad.cpp index ccdf640..aaf1595 100644 --- a/Execute/Elf/BaseLoad.cpp +++ b/Execute/Elf/BaseLoad.cpp @@ -165,7 +165,7 @@ namespace Execute void *ElfFile = KernelAllocator.RequestPages(TO_PAGES(ExFileSize + 1)); /* Copy the file to the allocated memory */ memcpy(ElfFile, (void *)ExFile.node->Address, ExFileSize); - debug("Image Size: %#lx - %#lx (length: %ld)", ElfFile, (uintptr_t)ElfFile + ExFileSize, ExFileSize); + debug("Elf file: %#lx - %#lx (length: %ld)", ElfFile, (uintptr_t)ElfFile + ExFileSize, ExFileSize); Elf64_Ehdr *ELFHeader = (Elf64_Ehdr *)ElfFile; diff --git a/Execute/Elf/Exec.cpp b/Execute/Elf/Exec.cpp index b61142d..891b220 100644 --- a/Execute/Elf/Exec.cpp +++ b/Execute/Elf/Exec.cpp @@ -107,7 +107,7 @@ namespace Execute if (ItrPhdr.p_vaddr == 0) EntryPoint += (uintptr_t)MemoryImage.Virtual; - char InterpreterPath[256]; + char InterpreterPath[256] = {'\0'}; for (Elf64_Half i = 0; i < ELFHeader->e_phnum; i++) {