From fa34f42fd6628ee0086b753461d54a8b4c18d170 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 25 Jun 2013 04:23:46 +0000 Subject: [PATCH] Don't assume ResultPath is null terminated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184824 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/PathV2.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Support/PathV2.cpp b/lib/Support/PathV2.cpp index cc654eea58b..c0be6f4ea16 100644 --- a/lib/Support/PathV2.cpp +++ b/lib/Support/PathV2.cpp @@ -638,7 +638,8 @@ error_code unique_file(const Twine &Model, SmallVectorImpl &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 &path) { -- 2.34.1