diff options
author | Filipe Cabecinhas <me@filcab.net> | 2015-05-26 23:52:21 +0000 |
---|---|---|
committer | Filipe Cabecinhas <me@filcab.net> | 2015-05-26 23:52:21 +0000 |
commit | bc6a90938426330a76ea1ec29d99ca7fcf46f447 (patch) | |
tree | 763355ab570ddc3ea9eda52d9d2f935ed7fc4914 /llvm/lib/Bitcode/Reader/BitstreamReader.cpp | |
parent | 85fa7d5037fed8191ef67c2b4d954218b942a7d1 (diff) | |
download | bcm5719-llvm-bc6a90938426330a76ea1ec29d99ca7fcf46f447.tar.gz bcm5719-llvm-bc6a90938426330a76ea1ec29d99ca7fcf46f447.zip |
[BitcodeReader] Make sure abbrev records have at least one operand (record code)
Bug found with AFL fuzz.
llvm-svn: 238265
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitstreamReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitstreamReader.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitstreamReader.cpp b/llvm/lib/Bitcode/Reader/BitstreamReader.cpp index 3b03f4b12b8..2d02549ce4e 100644 --- a/llvm/lib/Bitcode/Reader/BitstreamReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitstreamReader.cpp @@ -282,6 +282,9 @@ void BitstreamCursor::ReadAbbrevRecord() { } else Abbv->Add(BitCodeAbbrevOp(E)); } + + if (Abbv->getNumOperandInfos() == 0) + report_fatal_error("Abbrev record with no operands"); CurAbbrevs.push_back(Abbv); } |