summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/DataBufferHeap.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2013-07-24 18:17:35 +0000
committerGreg Clayton <gclayton@apple.com>2013-07-24 18:17:35 +0000
commit46a4426286174961fe9a2605cf06a2138c1ec2da (patch)
treecd4823ff4dbf0f7322a4bb23c87ea363f7d511c2 /lldb/source/Core/DataBufferHeap.cpp
parentbde11213e755879e651c6536db4529f1277d56ca (diff)
downloadbcm5719-llvm-46a4426286174961fe9a2605cf06a2138c1ec2da.tar.gz
bcm5719-llvm-46a4426286174961fe9a2605cf06a2138c1ec2da.zip
<rdar://problem/14521548>
Fixed a crasher where if you accidentally specify a size that is too large when reading memory, LLDB would crash. llvm-svn: 187060
Diffstat (limited to 'lldb/source/Core/DataBufferHeap.cpp')
-rw-r--r--lldb/source/Core/DataBufferHeap.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lldb/source/Core/DataBufferHeap.cpp b/lldb/source/Core/DataBufferHeap.cpp
index 74893767d14..2c8a865b966 100644
--- a/lldb/source/Core/DataBufferHeap.cpp
+++ b/lldb/source/Core/DataBufferHeap.cpp
@@ -24,8 +24,10 @@ DataBufferHeap::DataBufferHeap () :
// with "ch".
//----------------------------------------------------------------------
DataBufferHeap::DataBufferHeap (lldb::offset_t n, uint8_t ch) :
- m_data(n, ch)
+ m_data()
{
+ if (n < m_data.max_size())
+ m_data.assign (n, ch);
}
//----------------------------------------------------------------------
OpenPOWER on IntegriCloud