1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

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

This is a followup to rL333496.

Differential Revision: https://reviews.llvm.org/D47544

llvm-svn: 333929
This commit is contained in:
Sam Clegg 2018-06-04 17:01:20 +00:00
parent c7ecc0ce30
commit 5d9dbb96b7

View File

@ -107,6 +107,7 @@ getSectionPtr(const MachOObjectFile &O, MachOObjectFile::LoadCommandInfo L,
}
static const char *getPtr(const MachOObjectFile &O, size_t Offset) {
assert(Offset <= O.getData().size());
return O.getData().data() + Offset;
}