summaryrefslogtreecommitdiff
path: root/Libraries/LibELF/Validation.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-12-01 13:18:32 +0100
committerAndreas Kling <kling@serenityos.org>2020-12-01 13:18:32 +0100
commit6ec9901d1babaf88929b65b6e986527bb470b111 (patch)
treedac9d82426ebee93ed28c5b5b5235c826544fe56 /Libraries/LibELF/Validation.cpp
parente85aad6acc07bdf9f1dfcc72bee8b4cb2c80b1ee (diff)
downloadserenity-6ec9901d1babaf88929b65b6e986527bb470b111.zip
LibELF: Fix busted validation of section header location
Diffstat (limited to 'Libraries/LibELF/Validation.cpp')
-rw-r--r--Libraries/LibELF/Validation.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibELF/Validation.cpp b/Libraries/LibELF/Validation.cpp
index 389921d91c..8363cb8451 100644
--- a/Libraries/LibELF/Validation.cpp
+++ b/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;
}
- if (end_of_last_program_header < elf_header.e_shoff) {
+ if (elf_header.e_shoff < end_of_last_program_header) {
if (verbose) {
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);