Verify sizes when trying to read a BitcodeAbbrevOp
authorFilipe Cabecinhas <me@filcab.net>
Thu, 23 Apr 2015 13:25:35 +0000 (13:25 +0000)
committerFilipe Cabecinhas <me@filcab.net>
Thu, 23 Apr 2015 13:25:35 +0000 (13:25 +0000)
commitee48feadfde407206eecce83ce460cccfeeffe10
tree7a08f69e1f632ea98049529acac14692ffa7ec69
parent9316d89d55a16b2d30c0622de55aa1e73bb33b1a
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
llvm/include/llvm/Bitcode/BitstreamReader.h
llvm/lib/Bitcode/Reader/BitstreamReader.cpp
llvm/test/Bitcode/Inputs/invalid-abbrev-fixed-size-too-big.bc [new file with mode: 0644]
llvm/test/Bitcode/Inputs/invalid-abbrev-vbr-size-too-big.bc [new file with mode: 0644]
llvm/test/Bitcode/invalid.test