diff options
author | Filipe Cabecinhas <me@filcab.net> | 2015-04-23 13:25:35 +0000 |
---|---|---|
committer | Filipe Cabecinhas <me@filcab.net> | 2015-04-23 13:25:35 +0000 |
commit | ee48feadfde407206eecce83ce460cccfeeffe10 (patch) | |
tree | 7a08f69e1f632ea98049529acac14692ffa7ec69 /llvm/test | |
parent | 9316d89d55a16b2d30c0622de55aa1e73bb33b1a (diff) | |
download | bcm5719-llvm-ee48feadfde407206eecce83ce460cccfeeffe10.tar.gz bcm5719-llvm-ee48feadfde407206eecce83ce460cccfeeffe10.zip |
Verify sizes when trying to read a BitcodeAbbrevOp
Summary:
Make sure the abbrev operands are valid and that we can read/skip them
afterwards.
Bug found with AFL fuzz.
Reviewers: rafael
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9030
llvm-svn: 235595
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/Bitcode/Inputs/invalid-abbrev-fixed-size-too-big.bc | bin | 0 -> 612 bytes | |||
-rw-r--r-- | llvm/test/Bitcode/Inputs/invalid-abbrev-vbr-size-too-big.bc | bin | 0 -> 612 bytes | |||
-rw-r--r-- | llvm/test/Bitcode/invalid.test | 7 |
3 files changed, 7 insertions, 0 deletions
diff --git a/llvm/test/Bitcode/Inputs/invalid-abbrev-fixed-size-too-big.bc b/llvm/test/Bitcode/Inputs/invalid-abbrev-fixed-size-too-big.bc Binary files differnew file mode 100644 index 00000000000..8fa28960d72 --- /dev/null +++ b/llvm/test/Bitcode/Inputs/invalid-abbrev-fixed-size-too-big.bc diff --git a/llvm/test/Bitcode/Inputs/invalid-abbrev-vbr-size-too-big.bc b/llvm/test/Bitcode/Inputs/invalid-abbrev-vbr-size-too-big.bc Binary files differnew file mode 100644 index 00000000000..35d00ba154b --- /dev/null +++ b/llvm/test/Bitcode/Inputs/invalid-abbrev-vbr-size-too-big.bc diff --git a/llvm/test/Bitcode/invalid.test b/llvm/test/Bitcode/invalid.test index 5431368a0ad..b6c2ed3e8d6 100644 --- a/llvm/test/Bitcode/invalid.test +++ b/llvm/test/Bitcode/invalid.test @@ -66,3 +66,10 @@ RUN: not llvm-dis -disable-output %p/Inputs/invalid-fp-shift.bc 2>&1 | \ RUN: FileCheck --check-prefix=FP-SHIFT %s FP-SHIFT: Invalid record + +RUN: not llvm-dis -disable-output %p/Inputs/invalid-abbrev-vbr-size-too-big.bc 2>&1 | \ +RUN: FileCheck --check-prefix=HUGE-ABBREV-OP %s +RUN: not llvm-dis -disable-output %p/Inputs/invalid-abbrev-fixed-size-too-big.bc 2>&1 | \ +RUN: FileCheck --check-prefix=HUGE-ABBREV-OP %s + +HUGE-ABBREV-OP: Fixed or VBR abbrev record with size > MaxChunkData |