Pārlūkot izejas kodu

LibELF: Allow using ELF::Loader for ET_CORE objects

Itamar 4 gadi atpakaļ
vecāks
revīzija
50219429fd
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      Libraries/LibELF/Validation.cpp

+ 1 - 1
Libraries/LibELF/Validation.cpp

@@ -163,7 +163,7 @@ bool validate_elf_header(const Elf32_Ehdr& elf_header, size_t file_size, bool ve
         return false;
     }
 
-    if (elf_header.e_shstrndx >= elf_header.e_shnum) {
+    if (elf_header.e_shstrndx != SHN_UNDEF && elf_header.e_shstrndx >= elf_header.e_shnum) {
         if (verbose)
             dbgprintf("SHENANIGANS! Section header string table index (%d) is not a valid index given we have %d section headers!\n", elf_header.e_shstrndx, elf_header.e_shnum);
         return false;