diff options
author | Enrico Granata <egranata@apple.com> | 2015-06-15 21:37:05 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2015-06-15 21:37:05 +0000 |
commit | a44c0e3122fac1d00f655dc8ad509673a4a0c04c (patch) | |
tree | b98b3b526945610ff3431a96221487e6df005bf9 /lldb/source/Interpreter/OptionValueDictionary.cpp | |
parent | 2c901d48596ee3cabba97a98c63914a38b3d9166 (diff) | |
download | bcm5719-llvm-a44c0e3122fac1d00f655dc8ad509673a4a0c04c.tar.gz bcm5719-llvm-a44c0e3122fac1d00f655dc8ad509673a4a0c04c.zip |
Fix a bug where passing a value of the type "A B" to settings set target.env-vars would cause LLDB to crash
Fixes rdar://problem/21241817
llvm-svn: 239766
Diffstat (limited to 'lldb/source/Interpreter/OptionValueDictionary.cpp')
-rw-r--r-- | lldb/source/Interpreter/OptionValueDictionary.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lldb/source/Interpreter/OptionValueDictionary.cpp b/lldb/source/Interpreter/OptionValueDictionary.cpp index a209a694563..d2045470798 100644 --- a/lldb/source/Interpreter/OptionValueDictionary.cpp +++ b/lldb/source/Interpreter/OptionValueDictionary.cpp @@ -117,6 +117,12 @@ OptionValueDictionary::SetArgs (const Args &args, VarSetOperationType op) llvm::StringRef key_and_value(args.GetArgumentAtIndex(i)); if (!key_and_value.empty()) { + if (key_and_value.find('=') == llvm::StringRef::npos) + { + error.SetErrorString("assign operation takes one or more key=value arguments"); + return error; + } + std::pair<llvm::StringRef, llvm::StringRef> kvp(key_and_value.split('=')); llvm::StringRef key = kvp.first; bool key_valid = false; |