diff options
author | George Rimar <grimar@accesssoftek.com> | 2016-10-20 08:03:10 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2016-10-20 08:03:10 +0000 |
commit | de69e9f5db82d93b5ad901501c95227e77da024b (patch) | |
tree | 4417e6cec24c363593840ee9ef2e88f24034b460 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | e38da03f589901b08c800633e3077af528a9d4d8 (diff) | |
download | llvm-de69e9f5db82d93b5ad901501c95227e77da024b.zip llvm-de69e9f5db82d93b5ad901501c95227e77da024b.tar.gz llvm-de69e9f5db82d93b5ad901501c95227e77da024b.tar.bz2 |
[Object/ELF] - Check index argument in getSymbol().
Without this check LLD crashes when SHT_GROUP section has invalid symbol index
because of next code:
template <class ELFT>
StringRef elf::ObjectFile<ELFT>::getShtGroupSignature(const Elf_Shdr &Sec) {
..
const Elf_Sym *Sym = Obj.getSymbol(Symtab, Sec.sh_info);
..
}
If sh_info is too large, &Symbols[Index] just asserts.
No testcases provided because llvm-objdump/llvm-readelf does
not use getSymbol() function.
I`ll commit testcase for LLD separatelly.
Differential revision: https://reviews.llvm.org/D25516
llvm-svn: 284702
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions