[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 b343310b4f
commit 37dafba713
1 changed files with 2 additions and 0 deletions

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);
}
}