forked from OSchip/llvm-project
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:
parent
de9cab942b
commit
14699cf1c6
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue