summaryrefslogtreecommitdiffstats
path: root/lldb
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2017-07-24 16:47:04 +0000
committerGreg Clayton <gclayton@apple.com>2017-07-24 16:47:04 +0000
commit2434d45b85af800f79d72791488329c62c1b6c37 (patch)
tree5a60ae08975297f0e70d889eb5a4705185ad9863 /lldb
parentcdf471baef7868efce6b710eb8941eb6a7115032 (diff)
downloadbcm5719-llvm-2434d45b85af800f79d72791488329c62c1b6c37.tar.gz
bcm5719-llvm-2434d45b85af800f79d72791488329c62c1b6c37.zip
Don't crash when hostname is empty. StringRef will assert and kill your program.
llvm-svn: 308896
Diffstat (limited to 'lldb')
-rw-r--r--lldb/source/Utility/UriParser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Utility/UriParser.cpp b/lldb/source/Utility/UriParser.cpp
index bb57211af46..5023aa05d07 100644
--- a/lldb/source/Utility/UriParser.cpp
+++ b/lldb/source/Utility/UriParser.cpp
@@ -43,7 +43,7 @@ bool UriParser::Parse(llvm::StringRef uri, llvm::StringRef &scheme,
((path_pos != std::string::npos) ? path_pos : uri.size()) - host_pos);
// Extract hostname
- if (host_port[0] == '[') {
+ if (!host_port.empty() && host_port[0] == '[') {
// hostname is enclosed with square brackets.
pos = host_port.find(']');
if (pos == std::string::npos)
OpenPOWER on IntegriCloud