[Lldb-commits] [lldb] r215262 - Fix bug causing FileSpec::GetPath() to crash with a null dest.

Zachary Turner zturner at google.com
Fri Aug 8 16:54:35 PDT 2014


Author: zturner
Date: Fri Aug  8 18:54:35 2014
New Revision: 215262

URL: http://llvm.org/viewvc/llvm-project?rev=215262&view=rev
Log:
Fix bug causing FileSpec::GetPath() to crash with a null dest.

Modified:
    lldb/trunk/source/Host/common/FileSpec.cpp

Modified: lldb/trunk/source/Host/common/FileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/FileSpec.cpp?rev=215262&r1=215261&r2=215262&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/FileSpec.cpp (original)
+++ lldb/trunk/source/Host/common/FileSpec.cpp Fri Aug  8 18:54:35 2014
@@ -657,6 +657,9 @@ FileSpec::GetFilename() const
 size_t
 FileSpec::GetPath(char *path, size_t path_max_len, bool denormalize) const
 {
+    if (!path)
+        return 0;
+
     std::string result = GetPath(denormalize);
 
     size_t result_length = std::min(path_max_len-1, result.length());





More information about the lldb-commits mailing list