forked from OSchip/llvm-project
Fix a use-after-free in lldb-server
UriParser::Parse is returning a StringRef pointing the the parsed string, but we were calling it with a temporary string. Change this to a local variable to make sure the string persists as long as we need it. llvm-svn: 316740
This commit is contained in:
parent
52d0a49046
commit
ae7dd12a30
|
@ -128,8 +128,9 @@ Status GDBRemoteCommunicationServerPlatform::LaunchGDBServer(
|
|||
llvm::StringRef platform_ip;
|
||||
int platform_port;
|
||||
llvm::StringRef platform_path;
|
||||
bool ok = UriParser::Parse(GetConnection()->GetURI(), platform_scheme,
|
||||
platform_ip, platform_port, platform_path);
|
||||
std::string platform_uri = GetConnection()->GetURI();
|
||||
bool ok = UriParser::Parse(platform_uri, platform_scheme, platform_ip,
|
||||
platform_port, platform_path);
|
||||
UNUSED_IF_ASSERT_DISABLED(ok);
|
||||
assert(ok);
|
||||
|
||||
|
|
Loading…
Reference in New Issue