diff options
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp index 386f8ac80a5..f34a513f499 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp +++ b/llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp @@ -104,6 +104,10 @@ Error TpiStream::reload() { return EC; // Hash indices, hash values, etc come from the hash stream. + if (Header->HashStreamIndex >= Pdb.getNumStreams()) + return make_error<RawError>(raw_error_code::corrupt_file, + "Invalid TPI hash stream index."); + HashStream.reset(new MappedBlockStream( llvm::make_unique<IndexedStreamData>(Header->HashStreamIndex, Pdb), Pdb)); codeview::StreamReader HSR(*HashStream); |