Guard GetEscapedHostname against a nullptr hostname.

This can happen if you debug an iOS corefile on
a mac, where PlatformPOSIX::GetHostname ends up
not providing a hostname because we're working 
with a platform of remote-ios.

llvm-svn: 284799
This commit is contained in:
Jason Molenda 2016-10-21 02:32:08 +00:00
parent de9cab942b
commit 14699cf1c6
1 changed files with 2 additions and 0 deletions

View File

@ -36,6 +36,8 @@ const char *kSymFileExtension = ".sym";
const char *kFSIllegalChars = "\\/:*?\"<>|";
std::string GetEscapedHostname(const char *hostname) {
if (hostname == nullptr)
hostname = "unknown";
std::string result(hostname);
size_t size = result.size();
for (size_t i = 0; i < size; ++i) {