[PATCH] D88561: [llvm-readobj] - Fix possible crashes related to dumping gnu hash symbols.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 1 05:37:21 PDT 2020


grimar added inline comments.


================
Comment at: llvm/test/tools/llvm-readobj/ELF/hash-symbols.test:662
+
+## Case A: a hashed symbol can't be read, because of reading past the EOF attempt.
+# RUN: yaml2obj --docnum=11 -DVALUE=0x17 %s -o %t11.past.eof.so
----------------
jhenderson wrote:
> It's not clear from this comment what is causing the attempt to read past the end of file. Please could you clarify.
I've updated implementation and had to rework all test cases. Now there are no cases when we try read past the EOF - or at least I can't imagine an input for that atm.


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:4088
+            "unable to read the hash value: index (" + Twine(GnuHashable) +
+            ") goes past the end of the hash values array of size " +
+            Twine(Values.size())));
----------------
jhenderson wrote:
> Perhaps this - "length" implies the number of entries in the array, whereas "size" could mean either that or the total size taken up by the array (e.g. 4 times the length, if the elements are 4 bytes in size each).
This place is gone.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88561/new/

https://reviews.llvm.org/D88561



More information about the llvm-commits mailing list