diff --git a/kernel/src/sys/elf/ELFLoader.cpp b/kernel/src/sys/elf/ELFLoader.cpp index 0bc70cdd..00438fd0 100644 --- a/kernel/src/sys/elf/ELFLoader.cpp +++ b/kernel/src/sys/elf/ELFLoader.cpp @@ -143,7 +143,8 @@ int ELFLoader::check_elf_image(VFS::Node* node) kwarnln("ELF file has no PHDRS"); return -1; } - int i, loadable_sections; + int i; + int loadable_sections = 0; Elf64_Phdr phdr; for (VFS::read(node, elf_ehdr.e_phoff, sizeof(Elf64_Phdr), (char*)&phdr), i = 0; i < elf_ehdr.e_phnum; i++, VFS::read(node, elf_ehdr.e_phoff + (i * elf_ehdr.e_phentsize), sizeof(Elf64_Phdr), (char*)&phdr))