diff options
author | Johnny Chen <johnny.chen@apple.com> | 2011-12-19 22:51:27 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2011-12-19 22:51:27 +0000 |
commit | fee6e493b0062930f091847e68f14d9fc2bbd4bb (patch) | |
tree | 10d12f6d3594a062d31a08cc8ee8759f8bdc42cb /lldb/source/Core/UserSettingsController.cpp | |
parent | 5894a9138c188766e109f1d7de48c3d1fee0cec6 (diff) | |
download | bcm5719-llvm-fee6e493b0062930f091847e68f14d9fc2bbd4bb.tar.gz bcm5719-llvm-fee6e493b0062930f091847e68f14d9fc2bbd4bb.zip |
Work in progress for:
rdar://problem/10577182
Audit lldb API impl for places where we need to perform a NULL check
Add NULL checks for SBDebugger APIs.
llvm-svn: 146917
Diffstat (limited to 'lldb/source/Core/UserSettingsController.cpp')
-rw-r--r-- | lldb/source/Core/UserSettingsController.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lldb/source/Core/UserSettingsController.cpp b/lldb/source/Core/UserSettingsController.cpp index 91e4f0beb30..65c263f396e 100644 --- a/lldb/source/Core/UserSettingsController.cpp +++ b/lldb/source/Core/UserSettingsController.cpp @@ -280,7 +280,9 @@ UserSettingsController::SetVariable (const char *full_dot_name, ConstString const_var_name; const ConstString &default_name = InstanceSettings::GetDefaultName(); - Args names = UserSettingsController::BreakNameIntoPieces (full_dot_name); + Args names; + if (full_dot_name ) + names = UserSettingsController::BreakNameIntoPieces (full_dot_name); int num_pieces = names.GetArgumentCount(); if (num_pieces < 1) @@ -538,12 +540,18 @@ UserSettingsController::GetVariable Error &err ) { - Args names = UserSettingsController::BreakNameIntoPieces (full_dot_name); - ConstString const_var_name; StringList value; + if (!full_dot_name) + { + err.SetErrorString ("invalid variable name"); + return value; + } + Args names = UserSettingsController::BreakNameIntoPieces (full_dot_name); int num_pieces = names.GetArgumentCount(); + ConstString const_var_name; + ConstString prefix (names.GetArgumentAtIndex (0)); const_var_name.SetCString (names.GetArgumentAtIndex (num_pieces - 1)); |