diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:12:36 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:12:36 +0000 |
commit | ef5d0b5e97ec8e6fa395d377b09aa7755e345b4f (patch) | |
tree | 27916256fdeeb57d10d2f3d6948be5d71a703215 /source/Utility/UriParser.cpp | |
parent | 76e0736e7fcfeb179779e49c05604464b1ccd704 (diff) |
Notes
Diffstat (limited to 'source/Utility/UriParser.cpp')
-rw-r--r-- | source/Utility/UriParser.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/Utility/UriParser.cpp b/source/Utility/UriParser.cpp index bb57211af4687..a6d81e7a2c8b8 100644 --- a/source/Utility/UriParser.cpp +++ b/source/Utility/UriParser.cpp @@ -22,7 +22,7 @@ using namespace lldb_private; bool UriParser::Parse(llvm::StringRef uri, llvm::StringRef &scheme, llvm::StringRef &hostname, int &port, llvm::StringRef &path) { - llvm::StringRef tmp_scheme, tmp_hostname, tmp_port, tmp_path; + llvm::StringRef tmp_scheme, tmp_hostname, tmp_path; const llvm::StringRef kSchemeSep("://"); auto pos = uri.find(kSchemeSep); @@ -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) |