mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
One more additional error check for invalid Mach-O files for a
load command that use the MachO:: linkedit_data_command type but is not used in llvm libObject code but used in llvm tool code. This is for the LC_CODE_SIGNATURE load command. llvm-svn: 284529
This commit is contained in:
parent
03bf1de126
commit
e0896cb3d9
@ -833,6 +833,7 @@ MachOObjectFile::MachOObjectFile(MemoryBufferRef Object, bool IsLittleEndian,
|
||||
const char *FuncStartsLoadCmd = nullptr;
|
||||
const char *SplitInfoLoadCmd = nullptr;
|
||||
const char *CodeSignDrsLoadCmd = nullptr;
|
||||
const char *CodeSignLoadCmd = nullptr;
|
||||
const char *VersLoadCmd = nullptr;
|
||||
const char *SourceLoadCmd = nullptr;
|
||||
const char *EntryPointLoadCmd = nullptr;
|
||||
@ -885,6 +886,10 @@ MachOObjectFile::MachOObjectFile(MemoryBufferRef Object, bool IsLittleEndian,
|
||||
if ((Err = checkLinkeditDataCommand(this, Load, I, &CodeSignDrsLoadCmd,
|
||||
"LC_DYLIB_CODE_SIGN_DRS")))
|
||||
return;
|
||||
} else if (Load.C.cmd == MachO::LC_CODE_SIGNATURE) {
|
||||
if ((Err = checkLinkeditDataCommand(this, Load, I, &CodeSignLoadCmd,
|
||||
"LC_CODE_SIGNATURE")))
|
||||
return;
|
||||
} else if (Load.C.cmd == MachO::LC_DYLD_INFO) {
|
||||
if ((Err = checkDyldInfoCommand(this, Load, I, &DyldInfoLoadCmd,
|
||||
"LC_DYLD_INFO")))
|
||||
|
BIN
test/Object/Inputs/macho-invalid-codesign-bad-size
Normal file
BIN
test/Object/Inputs/macho-invalid-codesign-bad-size
Normal file
Binary file not shown.
@ -373,3 +373,6 @@ INVALID-ROUTINES-BAD-SIZE: macho-invalid-routines-bad-size': truncated or malfor
|
||||
|
||||
RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-routines64-more-than-one 2>&1 | FileCheck -check-prefix INVALID-ROUTINES64-MORE-THAN-ONE %s
|
||||
INVALID-ROUTINES64-MORE-THAN-ONE: macho-invalid-routines64-more-than-one': truncated or malformed object (more than one LC_ROUTINES_64 and or LC_ROUTINES command)
|
||||
|
||||
RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-codesign-bad-size 2>&1 | FileCheck -check-prefix INVALID-CODESIGN-BAD-SIZE %s
|
||||
INVALID-CODESIGN-BAD-SIZE: macho-invalid-codesign-bad-size': truncated or malformed object (LC_CODE_SIGNATURE command 0 has incorrect cmdsize)
|
||||
|
Loading…
Reference in New Issue
Block a user