From 1e4f425d2f0df8e79ad198d593ac7e620173938b Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Wed, 22 Aug 2012 21:21:16 +0000 Subject: [PATCH] Check that the data buffer is non-null before getting its file contents. llvm-svn: 162400 --- lldb/source/Target/Target.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index 5a49aab8e4e0..289944fe6ff9 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -2422,7 +2422,11 @@ TargetProperties::GetExpressionPrefixContentsAsCString () 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; }