[Object, MachO] Don't crash on incomplete MachO segment load commands.
authorAlexey Samsonov <vonosmas@gmail.com>
Thu, 4 Jun 2015 22:26:44 +0000 (22:26 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Thu, 4 Jun 2015 22:26:44 +0000 (22:26 +0000)
commitf8a7bf8c6ebc141ee7e0ae862d67362b946c04b0
tree2065bae48d425deceec4f4c45f0c71192fab684d
parent36e60e9127374c83f2eb7c705d1bd0dcb2a54d18
[Object, MachO] Don't crash on incomplete MachO segment load commands.

Report proper error code from MachOObjectFile constructor if we
can't parse another segment load command (we already return a proper
error if segment load command contents is suspicious).

llvm-svn: 239109
llvm/lib/Object/MachOObjectFile.cpp
llvm/test/Object/Inputs/macho64-invalid-incomplete-segment-load-command [new file with mode: 0644]
llvm/test/Object/macho-invalid.test