diff options
author | Jason Molenda <jmolenda@apple.com> | 2016-10-21 02:32:08 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2016-10-21 02:32:08 +0000 |
commit | 14699cf1c601d2e8f0b6bf6b8e651a14a5a1e42d (patch) | |
tree | 1812e246d2ebb7d199af8174a47c5ed29bda5c2f | |
parent | de9cab942bf1f91643c2a88d95d9d6a55fc1e77f (diff) | |
download | bcm5719-llvm-14699cf1c601d2e8f0b6bf6b8e651a14a5a1e42d.tar.gz bcm5719-llvm-14699cf1c601d2e8f0b6bf6b8e651a14a5a1e42d.zip |
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
-rw-r--r-- | lldb/source/Utility/ModuleCache.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lldb/source/Utility/ModuleCache.cpp b/lldb/source/Utility/ModuleCache.cpp index bf76db9f379..ed1e7668caa 100644 --- a/lldb/source/Utility/ModuleCache.cpp +++ b/lldb/source/Utility/ModuleCache.cpp @@ -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) { |