[Lldb-commits] [lldb] r152809 - /lldb/trunk/source/Interpreter/Args.cpp

Greg Clayton gclayton at apple.com
Thu Mar 15 10:10:48 PDT 2012


Author: gclayton
Date: Thu Mar 15 12:10:48 2012
New Revision: 152809

URL: http://llvm.org/viewvc/llvm-project?rev=152809&view=rev
Log:
<rdar://problem/11052829>

Fixed a case where if you have a argument stirng that ends with a '\' character, it would infinite loop while consuming all of your memory.

Also fixed a case where non-quote terminated strings would inefficiently be handled.


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

Modified: lldb/trunk/source/Interpreter/Args.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Args.cpp?rev=152809&r1=152808&r2=152809&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/Args.cpp (original)
+++ lldb/trunk/source/Interpreter/Args.cpp Thu Mar 15 12:10:48 2012
@@ -225,6 +225,7 @@
                     {
                         case '\0':
                             arg.append (arg_piece_start);
+                            ++arg_end;
                             arg_complete = true;
                             break;
 
@@ -311,6 +312,13 @@
                             }
                             quote_char = '\0';
                         }
+                        else
+                        {
+                            // Consume the rest of the string as there was no terminating quote
+                            arg.append(arg_piece_start);
+                            arg_end = arg_piece_start + strlen(arg_piece_start);
+                            arg_complete = true;
+                        }
                     }
                     break;
 





More information about the lldb-commits mailing list