diff options
author | George Rimar <grimar@accesssoftek.com> | 2016-10-17 09:30:06 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2016-10-17 09:30:06 +0000 |
commit | 71f3c1921a8c56123d74f65e62b0c736297ad0fa (patch) | |
tree | f5718a6d810b929667321bdc3c42337b706446b6 /llvm/test/Object/invalid.test | |
parent | ada286202e2ba878163787f31b26d952de30797a (diff) | |
download | bcm5719-llvm-71f3c1921a8c56123d74f65e62b0c736297ad0fa.tar.gz bcm5719-llvm-71f3c1921a8c56123d74f65e62b0c736297ad0fa.zip |
[Object/ELF] - Do not crash on invalid section index.
If object has wrong (large) string table index and
also incorrect large value for amount of sections in total,
then section index passes the check:
if (Index >= getNumSections())
return object_error::invalid_section_index;
But result pointer then is far after end of file data, what
result in a crash.
Differential revision: https://reviews.llvm.org/D25081
llvm-svn: 284369
Diffstat (limited to 'llvm/test/Object/invalid.test')
-rw-r--r-- | llvm/test/Object/invalid.test | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/test/Object/invalid.test b/llvm/test/Object/invalid.test index 9f5587422d1..d940789b6dc 100644 --- a/llvm/test/Object/invalid.test +++ b/llvm/test/Object/invalid.test @@ -41,7 +41,7 @@ RUN: not llvm-readobj --dyn-symbols %p/Inputs/invalid-sh_entsize.elf 2>&1 | File INVALID-DYNSYM-SIZE: Invalid entity size RUN: not llvm-readobj -t %p/Inputs/invalid-section-index.elf 2>&1 | FileCheck --check-prefix=INVALID-SECTION-INDEX %s - +RUN: not llvm-readobj -t %p/Inputs/invalid-section-index2.elf 2>&1 | FileCheck --check-prefix=INVALID-SECTION-INDEX %s INVALID-SECTION-INDEX: Invalid section index RUN: not llvm-readobj -s %p/Inputs/invalid-section-size.elf 2>&1 | FileCheck --check-prefix=INVALID-SECTION-SIZE %s |