[llvm] r271954 - [pdbdump] Verify the size of TPI hash records.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 6 16:19:24 PDT 2016
Author: ruiu
Date: Mon Jun 6 18:19:23 2016
New Revision: 271954
URL: http://llvm.org/viewvc/llvm-project?rev=271954&view=rev
Log:
[pdbdump] Verify the size of TPI hash records.
Modified:
llvm/trunk/lib/DebugInfo/PDB/Raw/TpiStream.cpp
Modified: llvm/trunk/lib/DebugInfo/PDB/Raw/TpiStream.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Raw/TpiStream.cpp?rev=271954&r1=271953&r2=271954&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/Raw/TpiStream.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/Raw/TpiStream.cpp Mon Jun 6 18:19:23 2016
@@ -103,7 +103,12 @@ Error TpiStream::reload() {
// Hash indices, hash values, etc come from the hash stream.
HashStream.reset(new MappedBlockStream(Header->HashStreamIndex, Pdb));
codeview::StreamReader HSR(*HashStream);
+
uint32_t NumHashValues = Header->HashValueBuffer.Length / sizeof(ulittle32_t);
+ if (NumHashValues != NumTypeRecords())
+ return make_error<RawError>(
+ raw_error_code::corrupt_file,
+ "TPI hash count does not match with the number of type records.");
HSR.setOffset(Header->HashValueBuffer.Off);
if (auto EC = HSR.readArray(HashValues, NumHashValues))
return EC;
More information about the llvm-commits
mailing list