Don't overflow GCTable
Summary: Bug found with AFL fuzz. Reviewers: rafael, dexonsmith Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9361 llvm-svn: 236200
This commit is contained in:
1 parent
d8a029c81b
commit
f8a16a952d
3 files changed
+6
-1
No files matched your search
@@ -2992,7 +2992,7 @@ std::error_code BitcodeReader::ParseModule(bool Resume,
|
||||
// FIXME: Change to an error if non-default in 4.0.
|
||||
Func->setVisibility(GetDecodedVisibility(Record[7]));
|
||||
if (Record.size() > 8 && Record[8]) {
|
||||
if (Record[8]-1 > GCTable.size())
|
||||
if (Record[8]-1 >= GCTable.size())
|
||||
return Error("Invalid ID");
|
||||
Func->setGC(GCTable[Record[8]-1].c_str());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user