[PATCH] D80215: [llvm-readelf] - --elf-hash-histogram: do not crash when the .gnu.hash goes past the EOF.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 19 08:07:37 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.

llvm-readelf might crash when the .gnu.hash table goes past the EOF.

This patch splits the code ot a helper function `checkGNUHashTable`,
which is similar to `checkHashTable` and fixes the issue.

Depends on D80204 <https://reviews.llvm.org/D80204>


https://reviews.llvm.org/D80215

Files:
  llvm/test/tools/llvm-readobj/ELF/hash-histogram.test
  llvm/tools/llvm-readobj/ELFDumper.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80215.264900.patch
Type: text/x-patch
Size: 4954 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200519/72c28a4c/attachment.bin>


More information about the llvm-commits mailing list