[Lldb-commits] [lldb] r162400 - /lldb/trunk/source/Target/Target.cpp
Jim Ingham
jingham at apple.com
Wed Aug 22 14:21:16 PDT 2012
Author: jingham
Date: Wed Aug 22 16:21:16 2012
New Revision: 162400
URL: http://llvm.org/viewvc/llvm-project?rev=162400&view=rev
Log:
Check that the data buffer is non-null before getting its file contents.
Modified:
lldb/trunk/source/Target/Target.cpp
Modified: lldb/trunk/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=162400&r1=162399&r2=162400&view=diff
==============================================================================
--- lldb/trunk/source/Target/Target.cpp (original)
+++ lldb/trunk/source/Target/Target.cpp Wed Aug 22 16:21:16 2012
@@ -2422,7 +2422,11 @@
const uint32_t idx = ePropertyExprPrefix;
OptionValueFileSpec *file = m_collection_sp->GetPropertyAtIndexAsOptionValueFileSpec (NULL, false, idx);
if (file)
- return (const char *)file->GetFileContents()->GetBytes();
+ {
+ DataBufferSP data_sp(file->GetFileContents());
+ if (data_sp)
+ return (const char *) data_sp->GetBytes();
+ }
return NULL;
}
More information about the lldb-commits
mailing list