summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/MachOObjectFile.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2018-06-04 17:01:20 +0000
committerSam Clegg <sbc@chromium.org>2018-06-04 17:01:20 +0000
commit675a51750a2d6783a7ef3434b64707ab1b5a90f0 (patch)
treee910c5d00a3732e870414aa56920cf2cbdc0be7c /llvm/lib/Object/MachOObjectFile.cpp
parent537afe6f0ebffce1815fa563134e0a661a42d032 (diff)
downloadbcm5719-llvm-675a51750a2d6783a7ef3434b64707ab1b5a90f0.tar.gz
bcm5719-llvm-675a51750a2d6783a7ef3434b64707ab1b5a90f0.zip
[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
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r--llvm/lib/Object/MachOObjectFile.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index 50dd476780e..731ff4e01fd 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/lib/Object/MachOObjectFile.cpp
@@ -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;
}
OpenPOWER on IntegriCloud