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

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 4 10:06:36 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL333929: [MachO] Add out-of-bounds check to MachOObjectFile.cpp (authored by sbc, committed by ).

Repository:
  rL LLVM

https://reviews.llvm.org/D47544

Files:
  llvm/trunk/lib/Object/MachOObjectFile.cpp


Index: llvm/trunk/lib/Object/MachOObjectFile.cpp
===================================================================
--- llvm/trunk/lib/Object/MachOObjectFile.cpp
+++ llvm/trunk/lib/Object/MachOObjectFile.cpp
@@ -107,6 +107,7 @@
 }
 
 static const char *getPtr(const MachOObjectFile &O, size_t Offset) {
+  assert(Offset <= O.getData().size());
   return O.getData().data() + Offset;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47544.149798.patch
Type: text/x-patch
Size: 389 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180604/d06466be/attachment.bin>


More information about the llvm-commits mailing list