diff options
| author | Jason Molenda <jmolenda@apple.com> | 2014-01-25 03:57:13 +0000 |
|---|---|---|
| committer | Jason Molenda <jmolenda@apple.com> | 2014-01-25 03:57:13 +0000 |
| commit | 6e20554ea8daf509571126f455848ce4aa817644 (patch) | |
| tree | d890e744792e74a438ebf4698b96976dbd88f9d7 /lldb/source/Plugins/Process/gdb-remote | |
| parent | 6b9ee9bce3abd48f42cbd41e34b08373384f0a59 (diff) | |
| download | bcm5719-llvm-6e20554ea8daf509571126f455848ce4aa817644.tar.gz bcm5719-llvm-6e20554ea8daf509571126f455848ce4aa817644.zip | |
Initialize the named_pipe_path in GDBRemoteCommunication::StartDebugserverProcess
right after the space for it is allocated on the stack, instead of trying
to initialize it in all the different places in this method. It's too easy
for another uninitialized code path to sneak in as it is written right now.
llvm-svn: 200066
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote')
| -rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index a377a639ef5..27cf86c4c25 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -669,6 +669,7 @@ GDBRemoteCommunication::StartDebugserverProcess (const char *hostname, debugserver_args.AppendArgument("--setsid"); char named_pipe_path[PATH_MAX]; + named_pipe_path[0] = '\0'; bool listen = false; if (host_and_port[0]) @@ -703,22 +704,15 @@ GDBRemoteCommunication::StartDebugserverProcess (const char *hostname, debugserver_args.AppendArgument("--named-pipe"); debugserver_args.AppendArgument(named_pipe_path); } - else - named_pipe_path[0] = '\0'; } - else - named_pipe_path[0] = '\0'; } else { - named_pipe_path[0] = '\0'; listen = true; } } else { - named_pipe_path[0] = '\0'; - // No host and port given, so lets listen on our end and make the debugserver // connect to us.. error = StartListenThread ("localhost", 0); |

