[DebugInfo] Do not hang when parsing a malformed .debug_pub* section.
authorIgor Kudrin <ikudrin@accesssoftek.com>
Thu, 9 Jul 2020 12:15:11 +0000 (19:15 +0700)
committerIgor Kudrin <ikudrin@accesssoftek.com>
Thu, 9 Jul 2020 12:15:11 +0000 (19:15 +0700)
commit68f5a8b2042b8c4dc83d1851b462a0570eb3410f
tree18f82a4343fb12ddc035f19af65622fb1d767b8f
parenta86ce06fafaa051554c6a21d487fa70e998dcafe
[DebugInfo] Do not hang when parsing a malformed .debug_pub* section.

The parsing method did not check reading errors and might easily fall
into an infinite loop on an invalid input because of that.

Differential Revision: https://reviews.llvm.org/D83049
lld/ELF/DWARF.h
lld/ELF/SyntheticSections.cpp
lld/test/ELF/gdb-index-invalid-pubnames.s [new file with mode: 0644]
llvm/include/llvm/DebugInfo/DWARF/DWARFDebugPubTable.h
llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
llvm/lib/DebugInfo/DWARF/DWARFDebugPubTable.cpp
llvm/test/tools/llvm-dwarfdump/X86/debug_pub_tables_invalid.s [new file with mode: 0644]