projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
91f199c
)
Check for null
author
Enrico Granata
<egranata@apple.com>
Fri, 2 Sep 2016 18:15:48 +0000
(18:15 +0000)
committer
Enrico Granata
<egranata@apple.com>
Fri, 2 Sep 2016 18:15:48 +0000
(18:15 +0000)
llvm-svn: 280513
lldb/source/Core/ValueObject.cpp
patch
|
blob
|
history
diff --git
a/lldb/source/Core/ValueObject.cpp
b/lldb/source/Core/ValueObject.cpp
index
609c518
..
6400e00
100644
(file)
--- a/
lldb/source/Core/ValueObject.cpp
+++ b/
lldb/source/Core/ValueObject.cpp
@@
-1251,6
+1251,13
@@
ValueObject::ReadPointedString (lldb::DataBufferSP& buffer_sp,
if (cstr_address_type == eAddressTypeHost && is_array)
{
const char* cstr = GetDataExtractor().PeekCStr(0);
+ if (cstr == nullptr)
+ {
+ s << "<invalid address>";
+ error.SetErrorString("invalid address");
+ CopyStringDataToBufferSP(s, buffer_sp);
+ return {0,was_capped};
+ }
buffer_sp.reset(new DataBufferHeap(cstr_len, 0));
memcpy(buffer_sp->GetBytes(), cstr, cstr_len);
return {cstr_len,was_capped};