forked from OSchip/llvm-project
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
This commit is contained in:
parent
6b9ee9bce3
commit
6e20554ea8
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue