diff options
| author | Pavel Labath <labath@google.com> | 2017-10-27 04:53:24 +0000 |
|---|---|---|
| committer | Pavel Labath <labath@google.com> | 2017-10-27 04:53:24 +0000 |
| commit | ae7dd12a301dc7acf2bf713e81154954b3f16372 (patch) | |
| tree | 37ef3e832a2d8764c376f682cd51b014f441be50 /lldb/source/Plugins/Process/gdb-remote | |
| parent | 52d0a49046f0393b315b5743c5f341ebc6b1da06 (diff) | |
| download | bcm5719-llvm-ae7dd12a301dc7acf2bf713e81154954b3f16372.tar.gz bcm5719-llvm-ae7dd12a301dc7acf2bf713e81154954b3f16372.zip | |
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
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote')
| -rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp index 977c34c2a69..04ed9d704e1 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp @@ -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); |

