1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

[COFFDumper] Make sure there is sufficient padding left in the checksum

llvm-svn: 271143
This commit is contained in:
David Majnemer 2016-05-28 19:45:58 +00:00
parent c990a21322
commit 224ed127b5

View File

@ -940,6 +940,8 @@ void COFFDumper::printCodeViewFileChecksums(StringRef Subsection) {
W.printBinary("ChecksumBytes", ChecksumBytes);
unsigned PaddedSize = alignTo(FC->ChecksumSize + sizeof(FileChecksum), 4) -
sizeof(FileChecksum);
if (PaddedSize > Data.size())
error(object_error::parse_failed);
Data = Data.drop_front(PaddedSize);
}
}