mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-12 12:33:17 +00:00
[CVRecord] Don't assume that the record has two bytes of data in it
llvm-svn: 271171
This commit is contained in:
parent
2fa58d5a19
commit
a1f3014900
@ -34,6 +34,8 @@ template <typename Kind> struct VarStreamArrayExtractor<CVRecord<Kind>> {
|
||||
if (auto EC = Reader.readObject(Prefix))
|
||||
return EC;
|
||||
Item.Length = Prefix->RecordLen;
|
||||
if (Item.Length < 2)
|
||||
return make_error<CodeViewError>(cv_error_code::corrupt_record);
|
||||
Item.Type = static_cast<Kind>(uint16_t(Prefix->RecordKind));
|
||||
if (auto EC = Reader.readBytes(Item.Data, Item.Length - 2))
|
||||
return EC;
|
||||
|
Loading…
x
Reference in New Issue
Block a user