[Lldb-commits] [lldb] r239766 - Fix a bug where passing a value of the type "A B" to settings set target.env-vars would cause LLDB to crash

Enrico Granata egranata at apple.com
Mon Jun 15 14:37:06 PDT 2015


Author: enrico
Date: Mon Jun 15 16:37:05 2015
New Revision: 239766

URL: http://llvm.org/viewvc/llvm-project?rev=239766&view=rev
Log:
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


Modified:
    lldb/trunk/source/Interpreter/OptionValueDictionary.cpp

Modified: lldb/trunk/source/Interpreter/OptionValueDictionary.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueDictionary.cpp?rev=239766&r1=239765&r2=239766&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/OptionValueDictionary.cpp (original)
+++ lldb/trunk/source/Interpreter/OptionValueDictionary.cpp Mon Jun 15 16:37:05 2015
@@ -117,6 +117,12 @@ OptionValueDictionary::SetArgs (const Ar
                 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;





More information about the lldb-commits mailing list