diff options
author | Kevin Enderby <enderby@apple.com> | 2015-10-08 22:50:55 +0000 |
---|---|---|
committer | Kevin Enderby <enderby@apple.com> | 2015-10-08 22:50:55 +0000 |
commit | 46e642f8c56022f4218699a7071996e7e0863ba2 (patch) | |
tree | 901792991fc338ff329ba2011f88c3283a07e4a1 /llvm/tools/llvm-objdump/MachODump.cpp | |
parent | 6eeaff169ddfbce483790bc6db3e08fe424f14ed (diff) | |
download | bcm5719-llvm-46e642f8c56022f4218699a7071996e7e0863ba2.tar.gz bcm5719-llvm-46e642f8c56022f4218699a7071996e7e0863ba2.zip |
Fix a bug in llvm-objdump’s printing of Objective-C meta data
from malformed Mach-O files that caused a crash because of a
section header had a size that extended past the end of the file.
rdar://22983603
llvm-svn: 249768
Diffstat (limited to 'llvm/tools/llvm-objdump/MachODump.cpp')
-rw-r--r-- | llvm/tools/llvm-objdump/MachODump.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp index b6b910f55dc..993e9e6817b 100644 --- a/llvm/tools/llvm-objdump/MachODump.cpp +++ b/llvm/tools/llvm-objdump/MachODump.cpp @@ -2340,6 +2340,8 @@ static const char *get_pointer_64(uint64_t Address, uint32_t &offset, for (unsigned SectIdx = 0; SectIdx != info->Sections->size(); SectIdx++) { uint64_t SectAddress = ((*(info->Sections))[SectIdx]).getAddress(); uint64_t SectSize = ((*(info->Sections))[SectIdx]).getSize(); + if (SectSize == 0) + continue; if (objc_only) { StringRef SectName; ((*(info->Sections))[SectIdx]).getName(SectName); |