diff options
author | Sean Callanan <scallanan@apple.com> | 2013-05-10 21:58:45 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2013-05-10 21:58:45 +0000 |
commit | ec537a24eb9b97549dff3739bbaf249221d85f09 (patch) | |
tree | 51c50ddfb9b7f83e316ef06d89a83b86151517b5 | |
parent | d7193795bd48bbacf3ab3f4d41801ad84c97d803 (diff) | |
download | bcm5719-llvm-ec537a24eb9b97549dff3739bbaf249221d85f09.tar.gz bcm5719-llvm-ec537a24eb9b97549dff3739bbaf249221d85f09.zip |
Hardened LLDB against NULL conditions being
passed to breakpoints.
<rdar://problem/13853205>
llvm-svn: 181636
-rw-r--r-- | lldb/source/Breakpoint/BreakpointLocation.cpp | 3 | ||||
-rw-r--r-- | lldb/source/Breakpoint/BreakpointOptions.cpp | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/lldb/source/Breakpoint/BreakpointLocation.cpp b/lldb/source/Breakpoint/BreakpointLocation.cpp index 04142b268e4..fe8267dcacd 100644 --- a/lldb/source/Breakpoint/BreakpointLocation.cpp +++ b/lldb/source/Breakpoint/BreakpointLocation.cpp @@ -254,7 +254,10 @@ BreakpointLocation::ConditionSaysStop (ExecutionContext &exe_ctx, Error &error) const char *condition_text = GetConditionText(&condition_hash); if (!condition_text) + { + m_user_expression_sp.reset(); return false; + } if (condition_hash != m_condition_hash || !m_user_expression_sp || diff --git a/lldb/source/Breakpoint/BreakpointOptions.cpp b/lldb/source/Breakpoint/BreakpointOptions.cpp index d0aaf47d8a6..3a4a117695f 100644 --- a/lldb/source/Breakpoint/BreakpointOptions.cpp +++ b/lldb/source/Breakpoint/BreakpointOptions.cpp @@ -162,6 +162,9 @@ BreakpointOptions::HasCallback () void BreakpointOptions::SetCondition (const char *condition) { + if (!condition) + condition = ""; + m_condition_text.assign(condition); std::hash<std::string> hasher; m_condition_text_hash = hasher(m_condition_text); |