summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2016-10-04 20:37:43 +0000
committerKevin Enderby <enderby@apple.com>2016-10-04 20:37:43 +0000
commitf993d6e72c6246edb30ca90415e448989e0d5fd5 (patch)
tree3e7f496feb885914749228118b12b29bb4d5a688 /llvm/test
parente356f1a50c0ef4311ab708dad4efc266cb1bc77c (diff)
downloadbcm5719-llvm-f993d6e72c6246edb30ca90415e448989e0d5fd5.tar.gz
bcm5719-llvm-f993d6e72c6246edb30ca90415e448989e0d5fd5.zip
Next set of additional error checks for invalid Mach-O files for the
load commands that uses the MachO::encryption_info_command and MachO::encryption_info_command types but not used in llvm libObject code but used in llvm tool code. This includes just LC_ENCRYPTION_INFO and LC_ENCRYPTION_INFO_64 load commands. llvm-svn: 283250
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Object/Inputs/macho-invalid-encrypt-bad-sizebin0 -> 52 bytes
-rw-r--r--llvm/test/Object/Inputs/macho-invalid-encrypt-cryptoffbin0 -> 48 bytes
-rw-r--r--llvm/test/Object/Inputs/macho-invalid-encrypt-more-than-onebin0 -> 72 bytes
-rw-r--r--llvm/test/Object/Inputs/macho-invalid-encrypt64-bad-sizebin0 -> 56 bytes
-rw-r--r--llvm/test/Object/Inputs/macho-invalid-encrypt64-cryptoff-cryptsizebin0 -> 52 bytes
-rw-r--r--llvm/test/Object/macho-invalid.test15
6 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/Object/Inputs/macho-invalid-encrypt-bad-size b/llvm/test/Object/Inputs/macho-invalid-encrypt-bad-size
new file mode 100644
index 00000000000..21204650f0a
--- /dev/null
+++ b/llvm/test/Object/Inputs/macho-invalid-encrypt-bad-size
Binary files differ
diff --git a/llvm/test/Object/Inputs/macho-invalid-encrypt-cryptoff b/llvm/test/Object/Inputs/macho-invalid-encrypt-cryptoff
new file mode 100644
index 00000000000..9ac14e28982
--- /dev/null
+++ b/llvm/test/Object/Inputs/macho-invalid-encrypt-cryptoff
Binary files differ
diff --git a/llvm/test/Object/Inputs/macho-invalid-encrypt-more-than-one b/llvm/test/Object/Inputs/macho-invalid-encrypt-more-than-one
new file mode 100644
index 00000000000..f5829da1917
--- /dev/null
+++ b/llvm/test/Object/Inputs/macho-invalid-encrypt-more-than-one
Binary files differ
diff --git a/llvm/test/Object/Inputs/macho-invalid-encrypt64-bad-size b/llvm/test/Object/Inputs/macho-invalid-encrypt64-bad-size
new file mode 100644
index 00000000000..945a6c3587c
--- /dev/null
+++ b/llvm/test/Object/Inputs/macho-invalid-encrypt64-bad-size
Binary files differ
diff --git a/llvm/test/Object/Inputs/macho-invalid-encrypt64-cryptoff-cryptsize b/llvm/test/Object/Inputs/macho-invalid-encrypt64-cryptoff-cryptsize
new file mode 100644
index 00000000000..756de66704d
--- /dev/null
+++ b/llvm/test/Object/Inputs/macho-invalid-encrypt64-cryptoff-cryptsize
Binary files differ
diff --git a/llvm/test/Object/macho-invalid.test b/llvm/test/Object/macho-invalid.test
index 9c902aff814..cf85dac689d 100644
--- a/llvm/test/Object/macho-invalid.test
+++ b/llvm/test/Object/macho-invalid.test
@@ -334,3 +334,18 @@ INVALID-ENTRY-BAD-SIZE: macho-invalid-entry-bad-size': truncated or malformed ob
RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-entry-more-than-one 2>&1 | FileCheck -check-prefix INVALID-ENTRY-MORE-THAN-ONE %s
INVALID-ENTRY-MORE-THAN-ONE: macho-invalid-entry-more-than-one': truncated or malformed object (more than one LC_MAIN command)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-encrypt-bad-size 2>&1 | FileCheck -check-prefix INVALID-ENCRYPT-BAD-SIZE %s
+INVALID-ENCRYPT-BAD-SIZE: macho-invalid-encrypt-bad-size': truncated or malformed object (LC_ENCRYPTION_INFO command 0 has incorrect cmdsize)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-encrypt64-bad-size 2>&1 | FileCheck -check-prefix INVALID-ENCRYPT64-BAD-SIZE %s
+INVALID-ENCRYPT64-BAD-SIZE: macho-invalid-encrypt64-bad-size': truncated or malformed object (LC_ENCRYPTION_INFO_64 command 0 has incorrect cmdsize)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-encrypt-more-than-one 2>&1 | FileCheck -check-prefix INVALID-ENCRYPT-MORE-THAN-ONE %s
+INVALID-ENCRYPT-MORE-THAN-ONE: macho-invalid-encrypt-more-than-one': truncated or malformed object (more than one LC_ENCRYPTION_INFO and or LC_ENCRYPTION_INFO_64 command)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-encrypt-cryptoff 2>&1 | FileCheck -check-prefix INVALID-ENCRYPT-CRYPTOFF %s
+INVALID-ENCRYPT-CRYPTOFF: macho-invalid-encrypt-cryptoff': truncated or malformed object (cryptoff field of LC_ENCRYPTION_INFO command 0 extends past the end of the file)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-encrypt64-cryptoff-cryptsize 2>&1 | FileCheck -check-prefix INVALID-ENCRYPT-CRYPTOFF-CRYPTSIZE %s
+INVALID-ENCRYPT-CRYPTOFF-CRYPTSIZE: macho-invalid-encrypt64-cryptoff-cryptsize': truncated or malformed object (cryptoff field plus cryptsize field of LC_ENCRYPTION_INFO_64 command 0 extends past the end of the file)
OpenPOWER on IntegriCloud