[llvm-readobj/elf] - Refine the code for broken PT_DYNAMIC segment diagnostic.
authorGeorgii Rymar <grimar@accesssoftek.com>
Thu, 20 Aug 2020 12:56:24 +0000 (15:56 +0300)
committerGeorgii Rymar <grimar@accesssoftek.com>
Fri, 21 Aug 2020 12:05:46 +0000 (15:05 +0300)
commitaa456a6df4931541c6aaf0e60a77cc646b5ad4c4
tree907aa7904711bd1c125c823f57f45793f784af95
parent519b0e3e9d6db21922d9a59c467d8b8709323a40
[llvm-readobj/elf] - Refine the code for broken PT_DYNAMIC segment diagnostic.

The code that reports "PT_DYNAMIC segment offset + size exceeds the size of the file"
has an issue: it is possible to bypass the validation by overflowing the size + offset result.

Differential revision: https://reviews.llvm.org/D85519
llvm/test/tools/llvm-readobj/ELF/malformed-pt-dynamic.test
llvm/tools/llvm-readobj/ELFDumper.cpp