From 3bc66f1f4733fd29792c11a686d416aa9ab4cc38 Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Tue, 20 Jan 2015 04:20:42 +0000 Subject: Fix creation of StringRef in FileSpec::ResolveUsername() so it doesn't assume that the SmallVector will have nul terminator. It did not in at least one case. Caught by ASAN instrumentation. llvm-svn: 226544 --- lldb/source/Host/common/FileSpec.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lldb/source/Host/common/FileSpec.cpp') diff --git a/lldb/source/Host/common/FileSpec.cpp b/lldb/source/Host/common/FileSpec.cpp index 0af0556d30c..98b4beffe28 100644 --- a/lldb/source/Host/common/FileSpec.cpp +++ b/lldb/source/Host/common/FileSpec.cpp @@ -65,7 +65,7 @@ FileSpec::ResolveUsername (llvm::SmallVectorImpl &path) if (path.empty() || path[0] != '~') return; - llvm::StringRef path_str(path.data()); + llvm::StringRef path_str(path.data(), path.size()); size_t slash_pos = path_str.find_first_of("/", 1); if (slash_pos == 1 || path.size() == 1) { -- cgit v1.2.3