[PATCH] D91787: [llvm-readobj] - Don't crash when relocation table goes past the EOF.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 20 00:31:44 PST 2020


jhenderson added a comment.

Would adding `--implicit-check-not=warning:` to the test cases be useful?



================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:131-132
+      : FileName(Owner.getFileName()), Owner(&Owner) {}
   DynRegionInfo(const uint8_t *A, uint64_t S, uint64_t ES, StringRef ObjName)
-      : Addr(A), Size(S), EntSize(ES), FileName(ObjName) {}
+      : Addr(A), Size(S), EntSize(ES), FileName(ObjName), Owner(nullptr) {}
 
----------------
Can't you change users of this overload in the same way, so that there's always an object?


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:168
+                        SizePrintName +
+                        "), it goes past the end of the file of size 0x" +
+                        Twine::utohexstr(ObjSize)),
----------------
I think this punctuation is slightly more correct English.


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

https://reviews.llvm.org/D91787



More information about the llvm-commits mailing list