diff --git a/Libraries/LibELF/Validation.cpp b/Libraries/LibELF/Validation.cpp index cb042b499c2..0afa0a54c51 100644 --- a/Libraries/LibELF/Validation.cpp +++ b/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;