diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-25 04:23:46 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-25 04:23:46 +0000 |
commit | 138e55aa5aa4e04f8195d4b8ca36d779db22ccb9 (patch) | |
tree | 9b2034891499cbbcce104bf5585fe8897b8f05e8 /llvm/lib/Support/PathV2.cpp | |
parent | 121124acf8d89a14e4a53b8c8f415a60291fc1ec (diff) | |
download | bcm5719-llvm-138e55aa5aa4e04f8195d4b8ca36d779db22ccb9.tar.gz bcm5719-llvm-138e55aa5aa4e04f8195d4b8ca36d779db22ccb9.zip |
Don't assume ResultPath is null terminated.
llvm-svn: 184824
Diffstat (limited to 'llvm/lib/Support/PathV2.cpp')
-rw-r--r-- | llvm/lib/Support/PathV2.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Support/PathV2.cpp b/llvm/lib/Support/PathV2.cpp index cc654eea58b..c0be6f4ea16 100644 --- a/llvm/lib/Support/PathV2.cpp +++ b/llvm/lib/Support/PathV2.cpp @@ -638,7 +638,8 @@ error_code unique_file(const Twine &Model, SmallVectorImpl<char> &ResultPath, if (close(FD)) return error_code(errno, system_category()); - return fs::remove(ResultPath.begin()); + StringRef P(ResultPath.begin(), ResultPath.size()); + return fs::remove(P); } error_code make_absolute(SmallVectorImpl<char> &path) { |