]> granicus.if.org Git - llvm/commit
[Object/ELF] - Fixed behavior when SectionHeaderTable->sh_size is too large.
authorGeorge Rimar <grimar@accesssoftek.com>
Thu, 27 Oct 2016 11:50:04 +0000 (11:50 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Thu, 27 Oct 2016 11:50:04 +0000 (11:50 +0000)
commit5e7dda5a1f04028974a00470831a0f65d18e8d39
tree686325eb1cd9146a1d88b5d407820e01c07afb4e
parent464f0d78860090891079469ba7678656e7c5a12a
[Object/ELF] - Fixed behavior when SectionHeaderTable->sh_size is too large.

Elf.h already has code checking that section table does not go past end of file.
Problem is that this check may not work on values greater than UINT64_MAX / Header->e_shentsize
because of calculation overflow.

Parch fixes the issue.

Differential revision: https://reviews.llvm.org/D25432

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285285 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Object/ELF.h
test/Object/Inputs/invalid-sections-num.elf [new file with mode: 0644]
test/Object/invalid.test