aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-05-27 16:16:45 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-05-27 16:16:45 +0000
commit5d842ea68ed1ba4e83b96d19beb8ab5d72b18677 (patch)
tree5358c5a9d7b6c4d49f4a55514720a922050606f3 /llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
parented8c1beefbe7b67bcfcecfbb1ea33a196f3f6861 (diff)
downloadllvm-5d842ea68ed1ba4e83b96d19beb8ab5d72b18677.zip
llvm-5d842ea68ed1ba4e83b96d19beb8ab5d72b18677.tar.gz
llvm-5d842ea68ed1ba4e83b96d19beb8ab5d72b18677.tar.bz2
Make sure the directory block array fits in the file
llvm-svn: 271011
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp b/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
index b04ccab..65ddcca 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
@@ -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();
}