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)
commit81f9bd3e1997bde935f834ed7be143b4b91088d1
tree349d7d194f01cc70479be15af33d0cea5bb9af7a
parent77aa4a8c4df240caa043b84e5340fe31eaa0962d
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235595 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Bitcode/BitstreamReader.h
lib/Bitcode/Reader/BitstreamReader.cpp
test/Bitcode/Inputs/invalid-abbrev-fixed-size-too-big.bc [new file with mode: 0644]
test/Bitcode/Inputs/invalid-abbrev-vbr-size-too-big.bc [new file with mode: 0644]
test/Bitcode/invalid.test