OSDN Git Service
(root)
/
android-x86
/
external-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
59250f2
)
[pdb] Fix size check when reading stream bytes.
author
Zachary Turner
<zturner@google.com>
Fri, 27 May 2016 20:17:33 +0000
(20:17 +0000)
committer
Zachary Turner
<zturner@google.com>
Fri, 27 May 2016 20:17:33 +0000
(20:17 +0000)
We were accidentally bounds checking the read against the output
ArrayRef instead of against the size of the read.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271040
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/DebugInfo/PDB/Raw/MappedBlockStream.cpp
patch
|
blob
|
history
diff --git
a/lib/DebugInfo/PDB/Raw/MappedBlockStream.cpp
b/lib/DebugInfo/PDB/Raw/MappedBlockStream.cpp
index
a3db147
..
acc92f9
100644
(file)
--- a/
lib/DebugInfo/PDB/Raw/MappedBlockStream.cpp
+++ b/
lib/DebugInfo/PDB/Raw/MappedBlockStream.cpp
@@
-26,9
+26,9
@@
MappedBlockStream::MappedBlockStream(uint32_t StreamIdx, const PDBFile &File) :
Error MappedBlockStream::readBytes(uint32_t Offset, uint32_t Size,
ArrayRef<uint8_t> &Buffer) const {
// Make sure we aren't trying to read beyond the end of the stream.
- if (
Buffer.size()
> StreamLength)
+ if (
Size
> StreamLength)
return make_error<RawError>(raw_error_code::insufficient_buffer);
- if (Offset > StreamLength -
Buffer.size()
)
+ if (Offset > StreamLength -
Size
)
return make_error<RawError>(raw_error_code::insufficient_buffer);
if (tryReadContiguously(Offset, Size, Buffer))