summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/Object/ELF.h6
-rw-r--r--llvm/test/Object/Inputs/invalid-sections-num.elfbin528 -> 0 bytes
-rw-r--r--llvm/test/Object/invalid.test3
3 files changed, 0 insertions, 9 deletions
diff --git a/llvm/include/llvm/Object/ELF.h b/llvm/include/llvm/Object/ELF.h
index 2c715bffa2f..d1de25d2821 100644
--- a/llvm/include/llvm/Object/ELF.h
+++ b/llvm/include/llvm/Object/ELF.h
@@ -347,12 +347,6 @@ ELFFile<ELFT>::ELFFile(StringRef Object, std::error_code &EC)
// The getNumSections() call below depends on SectionHeaderTable being set.
SectionHeaderTable =
reinterpret_cast<const Elf_Shdr *>(base() + SectionTableOffset);
- if (getNumSections() > UINT64_MAX / Header->e_shentsize) {
- // Section table goes past end of file!
- EC = object_error::parse_failed;
- return;
- }
-
const uint64_t SectionTableSize = getNumSections() * Header->e_shentsize;
if (SectionTableOffset + SectionTableSize > FileSize) {
diff --git a/llvm/test/Object/Inputs/invalid-sections-num.elf b/llvm/test/Object/Inputs/invalid-sections-num.elf
deleted file mode 100644
index d8d5bc8fe2b..00000000000
--- a/llvm/test/Object/Inputs/invalid-sections-num.elf
+++ /dev/null
Binary files differ
diff --git a/llvm/test/Object/invalid.test b/llvm/test/Object/invalid.test
index dd431aa3a55..a0016fef9d5 100644
--- a/llvm/test/Object/invalid.test
+++ b/llvm/test/Object/invalid.test
@@ -76,6 +76,3 @@ INVALID-SEC-ADDRESS-ALIGNMENT: Invalid data was encountered while parsing the fi
RUN: not llvm-readobj -t %p/Inputs/invalid-section-size2.elf 2>&1 | \
RUN: FileCheck --check-prefix=INVALID-SECTION-SIZE2 %s
INVALID-SECTION-SIZE2: Invalid data was encountered while parsing the file.
-
-RUN: not llvm-readobj -t %p/Inputs/invalid-sections-num.elf 2>&1 | FileCheck --check-prefix=INVALID-SECTION-NUM %s
-INVALID-SECTION-NUM: Invalid data was encountered while parsing the file.
OpenPOWER on IntegriCloud