diff options
author | Greg Clayton <gclayton@apple.com> | 2012-03-15 17:10:48 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2012-03-15 17:10:48 +0000 |
commit | 0c94313d200928c7b10a714de92849c06fac525d (patch) | |
tree | b672258000ccee6f0a5de888be9e51aa3570fc72 /lldb/source/Interpreter/Args.cpp | |
parent | b31e3af6fb972cb778a4fba13e9147253e6e91cb (diff) | |
download | bcm5719-llvm-0c94313d200928c7b10a714de92849c06fac525d.tar.gz bcm5719-llvm-0c94313d200928c7b10a714de92849c06fac525d.zip |
<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.
llvm-svn: 152809
Diffstat (limited to 'lldb/source/Interpreter/Args.cpp')
-rw-r--r-- | lldb/source/Interpreter/Args.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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; |