From 0c94313d200928c7b10a714de92849c06fac525d Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Thu, 15 Mar 2012 17:10:48 +0000 Subject: 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. llvm-svn: 152809 --- lldb/source/Interpreter/Args.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lldb/source/Interpreter') diff --git a/lldb/source/Interpreter/Args.cpp b/lldb/source/Interpreter/Args.cpp index dfd01ee1565..99ddddab5c7 100644 --- a/lldb/source/Interpreter/Args.cpp +++ b/lldb/source/Interpreter/Args.cpp @@ -225,6 +225,7 @@ Args::SetCommandString (const char *command) { case '\0': arg.append (arg_piece_start); + ++arg_end; arg_complete = true; break; @@ -311,6 +312,13 @@ Args::SetCommandString (const char *command) } 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; -- cgit v1.2.3