[PATCH] D79853: [llvm-readobj] - --gnu-hash-table: do not crash when the GNU hash table goes past the EOF.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 13 05:21:47 PDT 2020


grimar created this revision.
grimar added reviewers: jhenderson, MaskRay.
Herald added subscribers: rupprecht, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.

We might have a scenario where a the `GbuHashTable` variable correctly points
to a place inside the file (we validate this fact early in `parseDynamicTable`),
but nbuckets/maskwords fields are broken in the way the code tries
to read the data past the EOF. This patch fixes the issue.


https://reviews.llvm.org/D79853

Files:
  llvm/test/tools/llvm-readobj/ELF/gnuhash.test
  llvm/tools/llvm-readobj/ELFDumper.cpp
  llvm/tools/llvm-readobj/ObjDumper.h
  llvm/tools/llvm-readobj/llvm-readobj.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79853.263675.patch
Type: text/x-patch
Size: 5452 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200513/9d118a0d/attachment.bin>


More information about the llvm-commits mailing list