[llvm] r271011 - Make sure the directory block array fits in the file
David Majnemer via llvm-commits
llvm-commits at lists.llvm.org
Fri May 27 09:16:46 PDT 2016
Author: majnemer
Date: Fri May 27 11:16:45 2016
New Revision: 271011
URL: http://llvm.org/viewvc/llvm-project?rev=271011&view=rev
Log:
Make sure the directory block array fits in the file
Modified:
llvm/trunk/lib/DebugInfo/PDB/Raw/PDBFile.cpp
Modified: llvm/trunk/lib/DebugInfo/PDB/Raw/PDBFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Raw/PDBFile.cpp?rev=271011&r1=271010&r2=271011&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/Raw/PDBFile.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/Raw/PDBFile.cpp Fri May 27 11:16:45 2016
@@ -174,6 +174,10 @@ Error PDBFile::parseFileHeaders() {
return make_error<RawError>(raw_error_code::corrupt_file,
"Too many directory blocks.");
+ // Make sure the directory block array fits within the file.
+ if (auto EC = checkOffset(BufferRef, getDirectoryBlockArray()))
+ return EC;
+
return Error::success();
}
More information about the llvm-commits
mailing list