[PATCH] D47544: [MachO] Add out-of-bounds check to MachOObjectFile.cpp

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 4 09:32:35 PDT 2018


JDevlieghere added inline comments.


================
Comment at: lib/Object/MachOObjectFile.cpp:110
 static const char *getPtr(const MachOObjectFile &O, size_t Offset) {
+  assert(Offset <= O.getData().size());
   return O.getData().data() + Offset;
----------------
Is the goal to ensure the caller did the check or should we make this a runtime check? 


Repository:
  rL LLVM

https://reviews.llvm.org/D47544





More information about the llvm-commits mailing list