Ver código fonte

LibELF: Fix busted validation of section header location

Andreas Kling 4 anos atrás
pai
commit
6ec9901d1b
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      Libraries/LibELF/Validation.cpp

+ 1 - 1
Libraries/LibELF/Validation.cpp

@@ -148,7 +148,7 @@ bool validate_elf_header(const Elf32_Ehdr& elf_header, size_t file_size, bool ve
         return false;
         return false;
     }
     }
 
 
-    if (end_of_last_program_header < elf_header.e_shoff) {
+    if (elf_header.e_shoff < end_of_last_program_header) {
         if (verbose) {
         if (verbose) {
             dbgprintf("SHENANIGANS! Section header table begins at file offset %d, which is within program headers [ %d - %zu ]!\n",
             dbgprintf("SHENANIGANS! Section header table begins at file offset %d, which is within program headers [ %d - %zu ]!\n",
                 elf_header.e_shoff, elf_header.e_phoff, end_of_last_program_header);
                 elf_header.e_shoff, elf_header.e_phoff, end_of_last_program_header);