summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2016-10-27 11:41:57 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2016-10-27 11:41:57 +0000
commit3fb09b3a9e524b5efee5320e908b35b51ef58ff7 (patch)
tree57c0c722d9fcef393f5e7a51faf7ecfa6981f364 /llvm/test
parentd2611d50aa350ac14cf880b89061033bd0819a75 (diff)
downloadbcm5719-llvm-3fb09b3a9e524b5efee5320e908b35b51ef58ff7.tar.gz
bcm5719-llvm-3fb09b3a9e524b5efee5320e908b35b51ef58ff7.zip
[Object/ELF] - Do not crash if string table sh_size is equal to zero.
Revealed using "id_000038,sig_11,src_000015,op_havoc,rep_16" from PR30540, when sh_size was 0, crash happened. Differential revision: https://reviews.llvm.org/D25091 llvm-svn: 285282
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Object/Inputs/invalid-strtab-zero-size.elfbin0 -> 494 bytes
-rw-r--r--llvm/test/Object/invalid.test1
2 files changed, 1 insertions, 0 deletions
diff --git a/llvm/test/Object/Inputs/invalid-strtab-zero-size.elf b/llvm/test/Object/Inputs/invalid-strtab-zero-size.elf
new file mode 100644
index 00000000000..cb0d0d0d0f9
--- /dev/null
+++ b/llvm/test/Object/Inputs/invalid-strtab-zero-size.elf
Binary files differ
diff --git a/llvm/test/Object/invalid.test b/llvm/test/Object/invalid.test
index fda5d6d66d6..352917987de 100644
--- a/llvm/test/Object/invalid.test
+++ b/llvm/test/Object/invalid.test
@@ -1,6 +1,7 @@
RUN: not llvm-dwarfdump %p/Inputs/invalid-bad-rel-type.elf 2>&1 | FileCheck %s
RUN: not llvm-objdump -s %p/Inputs/invalid-strtab-type.elf 2>&1 | FileCheck %s
RUN: not llvm-objdump -s %p/Inputs/invalid-strtab-size.elf 2>&1 | FileCheck %s
+RUN: not llvm-objdump -s %p/Inputs/invalid-strtab-zero-size.elf 2>&1 | FileCheck %s
CHECK: Invalid data was encountered while parsing the file
RUN: not llvm-objdump -s %p/Inputs/invalid-strtab-non-null.elf 2>&1 | FileCheck --check-prefix=NON-NULL %s
OpenPOWER on IntegriCloud