projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
65e0642
)
Fix creation of StringRef in FileSpec::ResolveUsername()
author
Jason Molenda
<jmolenda@apple.com>
Tue, 20 Jan 2015 04:20:42 +0000
(
04:20
+0000)
committer
Jason Molenda
<jmolenda@apple.com>
Tue, 20 Jan 2015 04:20:42 +0000
(
04:20
+0000)
so it doesn't assume that the SmallVector<char> 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
patch
|
blob
|
history
diff --git
a/lldb/source/Host/common/FileSpec.cpp
b/lldb/source/Host/common/FileSpec.cpp
index 0af0556d30c9fcf71c2bf142f636da66681ec70d..98b4beffe286775a8f967f121aac0f3315e10dc7 100644
(file)
--- a/
lldb/source/Host/common/FileSpec.cpp
+++ b/
lldb/source/Host/common/FileSpec.cpp
@@
-65,7
+65,7
@@
FileSpec::ResolveUsername (llvm::SmallVectorImpl<char> &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)
{